PDA

View Full Version : Dynamically Adding Tooltips and DD's Sticky Tooltip Script



moab
03-24-2015, 04:35 PM
I've implemented Dynamic Drive's Sticky Tooltip Script (Found here: http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm) and have it working just fine.

However, when I create additional elements via JS and related tooltips, the new tooltips don't show up though the content of said tooltip is added to the proper div and in the proper format.

I suspect this is because the sticky tooltip script is doing some "magic" that I don't understand on init that is missing for the new elements I've created.

My question is: How can I add new elements and related tooltips to my page and have the tooltip work?

Thanks for any advice.

Note: I've tried putting the call to "stickytooltip.init("*[data-tooltip]", "mystickytooltip"); after my newly created elements, but to no avail.

Beverleyh
03-24-2015, 08:14 PM
Wild stab in the dark because I'm not sure what you're doing exactly - maybe you can glean what you need from these: http://stackoverflow.com/a/12022181 and http://stackoverflow.com/a/15090957

If you need more help, please provide a link to your page.