For simplicity, I'd like to enable the jQuery UI tooltip widget on all elements of the page:
Then disable it for certain elements or elements and their descendants. But this doesn't seem to work:
$(document).tooltip({ track: true }); $('#menu *[title]').tooltip({ disabled: true });
My $('#menu *[title]')
selector seems to work as I expect, getting all descendant elements that have a title attribute of the #menu element.
So why isn't the disabled option working in .tooltip({ disabled: true });
to disable the tooltip on those elements? Is there another way and/or better way to accomplish this?
$(document). tooltip("disable"); $(document). tooltip("enable");
The tooltip position is specified with two different configuration properties: position and offset . The position property specifies the position in relation to the trigger element. For example, a value of 'bottom center' will place the tooltip on the bottom edge of the trigger, centered horizontally.
The jQuery UI tooltip() method adds tooltip to any element on which you want to display tooltip. It gives a fade animation by default to show and hide the tooltip, compared to just toggling the visibility. Syntax: You can use the tooltip() method in two forms. $(selector, context).tooltip (options) Method.
Set tooltip on all elements with:
$('*').tooltip();
And disable with
$('#menu *[title]').tooltip('disable');
A la:
jsFiddle
None of the answers above worked for me, it seems like the way to do this now is to use the items option:
$("*").tooltip({ items: ':not(.menu)' });
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