How can I use "{$ link-getImageLink ($ product-link_rewrite," + imahov + "," small_default ")}" as a string in jquery?

0

I think the problem is the bracket { that can not be taken as text

Try using this feature:

$('.attribute_list li a img').on('mouseover', function () {
var imahov = $(this).attr("alt");
$("a.jqzoom img").attr("src",  "{$link->getImageLink($product->link_rewrite, " + imahov + ", 'small_default')}");
}); 

But this part "{$link->getImageLink($product->link_rewrite, " + imahov + ", 'small_default')}" causes me problems, the variable imahov is not taking it as a variable and I take it as text.

I tried to divide it like this:

$('.attribute_list li a img').on('mouseover', function () {
var imahov = $(this).attr("alt");
var prim = "{$link->getImageLink($product->link_rewrite, ";
var fin = ", 'small_default')}";
$("a.jqzoom img").attr("src",  prim + imahov + fin);
}); 

But the variables prim and end turn out to be an error, apparently the problem is the bracket.

Any suggestions?

    
asked by Jose Angel Lopez 06.12.2018 в 21:09
source

0 answers