Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delay show/hide of bootstrap-tooltips?

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 ?

like image 235
Spyros Avatar asked Mar 02 '13 05:03

Spyros


People also ask

How do I make my tooltip always visible?

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 do I show tooltip in bootstrap?

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.

Which of the following is correct about the data delay data attributes of tooltip plugin?

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.


1 Answers

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.

like image 148
azeós Avatar answered Sep 22 '22 12:09

azeós