How to get jquery Tooltipster Plugin to work for newly created DOM elements?

左心房为你撑大大i 提交于 2019-12-21 16:54:34

问题


I'm using the Tooltipster plugin http://calebjacob.com/tooltipster/ which is great but I have dynamically generated content that's being inserted into the DOM. It doesn't seem like tooltipster is detecting those as it's being set to trigger on Document Ready.

I know this is a bit of an esoteric plugin but any ideas on how to get the plugin to work for newly created elements in the DOM?

Thanks


回答1:


Try this one

$(document).on('mouseover', '.ololo', function(event) { $(this).tooltipster({multiple:true}); });




回答2:


Just add the instantiation script in the ajax content too.

Also set the option "multiple:true"

Its worked for me




回答3:


I think it would be accomplished if you write you plugin load code after the DOM has finished loading. You may write inside:

$(window).load(function()

});

As this executes after all DOM has finished loading.



来源:https://stackoverflow.com/questions/19187895/how-to-get-jquery-tooltipster-plugin-to-work-for-newly-created-dom-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!