I want to have a tooltip using foundation 5 that appears only on click (disable on hover) and that can be closed.
Basically something to the first tooltip you see in this joyride example but without using joyride.
I couldn't find a way to fix it and documentation is scarce for it, How could this be possibly hacked around?
Seems like you would have to modify the source of the foundation library you're working with. In the Foundation.lib.tooltip it sets up an event listener for
mouseenter
andmouseleave
. You would want to delete and only have listeners totouchstart
(for mobile / touchscreen devices) & a mouseclick (which I'm assuming is whatMSPointerDown
does).reference: https://github.com/zurb/foundation/blob/master/js/foundation/foundation.tooltip.js#L62
I think you could also clear the logic on lines 86 - 92 that only follows the tooltip if the user has hovered over the tooltip for a certain duration
https://github.com/zurb/foundation/blob/master/js/foundation/foundation.tooltip.js#L86-L92