Last week I lost a whole day together with a colleague investigating why our jQuery UI Tooltip widget didn’t want to work. Here is the original code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id="test">show tooltip</span> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$("#test").tooltip({content:'hello tooltip!'}); | |
}); |
After a long search and a lot of head scratching we finally discovered the cause; the jQuery UI tooltip only works when you specify a title on the tooltip you want to use(even when you want to specify your own content.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span id="test" title="this title is required to make the jQuery UI tooltip work">show tooltip</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$("#test").tooltip({content:'hello tooltip'}); | |
}); |