3
I have the following problem:
I am getting the value of data-img when I do Hover in class . gettoll, but I need to replace this value here content: "<img src='IMAGEM AQUI'>",
when hovering over each of the items, the problem is that they are all displaying the same image.
OBS: as
li's
are within awhile()
using a Carousel I I simplified to put here...
Would anyone have any idea how to solve the problem ?
JS
<script>
$(document).ready(function() {
$(".gettool").hover(function(){
var imagetooltip = $(this).data("img");
console.log(imagetooltip);
});
$(".tooltip").tooltipster({
animation: "grow",
contentAsHTML: true,
content: "<img src='IMAGEM AQUI'>",
multiple: true
});
});
</script>
HTML
<ul>
<li><a href="#" class="gettool tooltip" data-img="images/qualquer.jpg"><img src="images/01.jpg"></a></li>
<li><a href="#" class="gettool tooltip" data-img="images/qualquer.jpg"><img src="images/01.jpg"></a></li>
<li><a href="#" class="gettool tooltip"data-img="images/qualquer.jpg"><img src="images/01.jpg"></a></li>
</ul>
Perfect! thank you so much solved exactly the problem.
– Pablo Campina