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?
If you use selector instead of
$(document)
, don't forget to call that code at the right moment.None of the above worked for me...but this did (after initializaion):
Set tooltip on all elements with:
And disable with
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:
Here is what I am doing right now..
Show tool tip for:
Here is my javascript code.
According to jQueryUI docs as of my answer date.
$( ".selector" ).tooltip( "option", "disabled", true );