You can use selector
delegation option.
See the docs: http://twitter.github.io/bootstrap/javascript.html#tooltips
$('body').tooltip({
placement:'bottom',
selector: '[data-toggle=tooltip]'
});
Question
To make sure that the items that are dynamically created are intercepted by the events using the method .on
:
$('body').on('click', '.element',...
But if I wanted to intercept the new elements of a plugin, how can you do?
For example using the plugin tooltip bootstrap:
if I create a new element, to ensure that this is intercepted by the tooltip plugin I have to call again:
$('a').tooltip();
This is a system not as good as I have to continually repeat code for every new element that I create ..
So there is a way to refresh the elements?
Solution
You can use selector
delegation option.
See the docs: http://twitter.github.io/bootstrap/javascript.html#tooltips
$('body').tooltip({
placement:'bottom',
selector: '[data-toggle=tooltip]'
});
OTHER TIPS
Take a look at this fiddle, i'm using:
$('body').on('mouseenter', 'a', function(){$(this).tooltip();});