2017-06-05 60 views
0

我正在動態地將圖像添加到下面的jQuery的跨度。第二次動態創建元素的引導工具提示

我想顯示bootstrap工具提示圖像的鼠標輸入,工具提示來臨,但從第二次。

$('span').append('<img src="Edited-Message.png" data-toggle="tooltip" data-placement="right" class="EditedChat" title="Removed />'); 

我使用jQuery的下面添加工具提示: -

$("body").on("mouseenter", "img.EditedChat", function() { 
    $(this).tooltip(); 
}); 

TIA。

回答

1

綁定在圖像上重新定位提示時,它已經完成加載:

$(img).load(function(){ $element.tooltipster('reposition') }) 
+0

我應該在哪裏寫的document.ready這條線?或在$(「body」)。on(「mouseenter」,「img.EditedChat」,function(){ –

相關問題