Reputation: 407
I am dynamically adding an image to a span with below jQuery.
I want to show bootstrap tooltip on image's mouse enter, tooltip coming but from second time.
$('span').append('<img src="Edited-Message.png" data-toggle="tooltip" data-placement="right" class="EditedChat" title="Removed />');
I am using following jQuery to add tooltip :-
$("body").on("mouseenter", "img.EditedChat", function () {
$(this).tooltip();
});
TIA.
Upvotes: 0
Views: 191
Reputation: 1641
Bind on the image to reposition the tooltip when it has finished loading :
$(img).load(function(){ $element.tooltipster('reposition') })
Upvotes: 1