Menu icon Foundation
How to toggle a tooltip?

Hi, 

I had trouble with removing a tooltip but got helped by this old thread: https://foundation.zurb.com/forum/posts/2341-tooltips-dont-auto-hide-if-parent-element-is-removed-from-dom

Now my question is: How do I toggle a tooltip? I want the user to be able to click an element, and the tooltip should show up. Clicking again, and it disappears.

I have tried to use the onclick-event, but it seems to happen _after_ the tooltip has got it too, so tooltip is already visible. Otherwise, I would have been able to cancel the onclick-event, so it does not bubble on. 

I am using latest Zurb always. 

 

tooltiptoggle

Hi, 

I had trouble with removing a tooltip but got helped by this old thread: https://foundation.zurb.com/forum/posts/2341-tooltips-dont-auto-hide-if-parent-element-is-removed-from-dom

Now my question is: How do I toggle a tooltip? I want the user to be able to click an element, and the tooltip should show up. Clicking again, and it disappears.

I have tried to use the onclick-event, but it seems to happen _after_ the tooltip has got it too, so tooltip is already visible. Otherwise, I would have been able to cancel the onclick-event, so it does not bubble on. 

I am using latest Zurb always.