I use this tooltip to make a tooltip on an element like
$('.showtooltip').tooltip({
delay: 0,
track: true,
showURL: false,
bodyHandler: function() {
var tipStr = "SOME DISPLAY HTML";
return $(tipStr);
}
});
And my ajax will create the element dynamically.
$("<img alt='' class='showtooltip' src='image.jpg' />");
therefore, when this image is added to the document. Tooltip is not displayed. Then I use live () in jquery:
$(".showtooltip").live("mouseover", function() {
$(this).tooltip({
delay: 0,
track: true,
showURL: false,
bodyHandler: function() {
var tipStr = "SOME DISPLAY HTML";
return $(tipStr);
}
})
});
But the tooltip is displayed only after the first mouse click on the image. How can I use a tooltip for a dynamic item?
source
share