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:

jsfiddle

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]' }); 

demo: jsfiddle


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -