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?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- How to fix IE ClearType + jQuery opacity problem i
- void before promise syntax
- jQuery add and remove delay
I struggled too with this, but I came up with a solution! In my case I use Jquery Sortable which is ofcourse annoying when you have tooltips flying around!
So I made a variable
And since almost every tooltip has an init() function, I created
So, this can be the easiest enable/disable function!
To permanently disable a tooltip:
$('[data-toggle="tooltip"]').tooltip("disable");
To stop the tooltip from being displayed on hover but have the ability to re-enable it:
$('[data-toggle="tooltip"]').tooltip("destroy");
$('[data-toggle="tooltip"]').tooltip(); // re-enabling
I found a way to do it using CSS! Just add
.tooltip { visibility: hidden }
to your CSS file.If you want to make your link accessibility friendly without the tooltip, then just add
aria-label= "Here's a link description."
Hope this helps!
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.
Can you try:
Don't forget to change the selector. Works fine for me... http://jsfiddle.net/D9JTZ/