This works only for desktop view
This method we "discovered" will initialize the jQuery UI tooltip widget on every single element which has the attribute
[title]and then close the widget on
As you've known already, jQuery UI tooltip widget is developed to enhance the
titledisplay of an
Before we look at the snippets
- // This is a comment line. It starts with (//).
- /* This is a comment block.
It can consist of multiple lines. */
#2 Remove the transition on tooltip (to make it faster, kinda)
The #1 and #2 methods will close the tooltip widget, but then, the default display of [title] attribute will be displayed afterward. To compensate that, let's go to snippet #3.#3 Initialize, remove the transition on tooltip, empty the [title] attribute, and then re-add that on
Where's the demo?
This blog is using jQuery UI with customized tooltip (the 3rd snippet, for desktop view). You can try it out here. Such as the empty-action button below.
The 3rd method didn't work for a[target='_blank'] element. Because of the window (tab) switching.
Probably you can add something else for that particular element.