Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
76
rated 0 times [  83] [ 7]  / answers: 1 / hits: 50459  / 12 Years ago, fri, november 16, 2012, 12:00:00

According the documentation is is possible to turn off the functionality just doing $('body').off('.alert.data-api').

In the case of tooltip I tried the following from js console $('body').off('.tooltip.data-api') but it does not disable the tooltip on bottons.

Any hints how to precede?


More From » jquery

 Answers
70

You can't disable tooltips that way because it has no event listener on the body. Instead, you can disable the tooltips themselves using the code below.



$('[rel=tooltip]').tooltip()          // Init tooltips
$('[rel=tooltip]').tooltip('disable') // Disable tooltips
$('[rel=tooltip]').tooltip('enable') // (Re-)enable tooltips
$('[rel=tooltip]').tooltip('destroy') // Hide and destroy tooltips





Edit: For Bootstrap 4, the 'destroy' command has been replaced by the 'dispose' command, so:



$('[rel=tooltip]').tooltip('dispose') // Hide and destroy tooltips in Bootstrap 4 

[#81961] Wednesday, November 14, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
travion

Total Points: 137
Total Questions: 96
Total Answers: 103

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
travion questions
Mon, Dec 16, 19, 00:00, 5 Years ago
Sat, Oct 19, 19, 00:00, 5 Years ago
Fri, Sep 20, 19, 00:00, 5 Years ago
Wed, Nov 14, 18, 00:00, 6 Years ago
Sun, Oct 28, 18, 00:00, 6 Years ago
;