I am having trouble making that data-delay attribute of twitter bootstrap tooltips work. I am using it like :
Here is how i use it :
<a href="#" data-toggle="tooltip" data-delay="{ show: 5000, hide: 3000}">with delay</a> <script> jQuery('a[data-toggle="tooltip"]').tooltip().click( function(e) { e.preventDefault(); }); </script>
but i don't see any delay on show/hide. Any ideas why ?
Single element To make an element display its tooltip permanently, we use its showTooltipOn property. To make tooltip always be shown, set it to "always" .
How To Create a Tooltip. To create a tooltip, add the data-toggle="tooltip" attribute to an element. Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.
Q 18 - Which of the following is correct about data-delay Data attribute of Tooltip Plugin? A - Sets the default title value if the title attribute isn't present.
Finally I got it working with data attribute.
data-delay='{"show":"5000", "hide":"3000"}'
The object must be surrounded by single quotes, keys with double quotes and values with double or none, probably depends on the type. Is the only way that works.
This works for popovers too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With