Are tooltips (popovers) supposed to work on newly added elements?
If they are just inserted in dome with jquery:
link
It does not work for me only after I attach $(‘a’).tooltip() plugin manually.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you should call
.tooltip()” to initialize it, especially if you are dynamically inserting a new element. This is also the case for most of the plugins.Otherwise you would have to implement a listener to check if any element that requires tooltips are added (i.e. via
setTimeout, etc); which wouldn’t be so efficient.On the other hand; some plugin features might not fully depend on Javascript triggers. The CSS-only controls will always pick it up when a new element is created and has the referenced CSS class or id in the style sheet.