Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto hide bootstrap tooltip

I want to hide automatically the Boostrap tooltip after few seconds.

 <input type="text" title="" data-placement="bottom" style="width:200px" data-toggle="tooltip" autocomplete="off" data-provide="typeahead" class="form-control Waring" name="medicine_name" id="medicine_name" data-original-title="Please Enter Valid medicine name">
like image 979
Dhanil Avatar asked Aug 01 '14 08:08

Dhanil


People also ask

How do I make tooltip always show?

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" .

Can a disabled button have a tooltip?

Button or link elements with disabled class and attribute is not interactive. It means users cannot focus, hover, or click them to trigger a tooltip (or popover) or any functions.


1 Answers

I use this for page-wide auto-hide on all bootstrap tooltips:

$(function () {
   $(document).on('shown.bs.tooltip', function (e) {
      setTimeout(function () {
        $(e.target).tooltip('hide');
      }, 10000);
   });
});
like image 91
Lars Holm Jensen Avatar answered Oct 04 '22 19:10

Lars Holm Jensen