jquery - Refresh new element -
to make sure items dynamically created intercepted events using method .on
:
$('body').on('click', '.element',...
but if wanted intercept new elements of plugin, how can do?
for example using plugin tooltip bootstrap:
if create new element, ensure intercepted tooltip plugin have call again:
$('a').tooltip();
this system not have continually repeat code every new element create ..
so there way refresh elements?
you can use selector
delegation option.
see docs: http://twitter.github.io/bootstrap/javascript.html#tooltips
$('body').tooltip({ placement:'bottom', selector: '[data-toggle=tooltip]' });
Comments
Post a Comment