Posted By

mattvbiggs on 11/24/10



Versions (?)

JQuery: Displaying a Tooltip

 / Published in: jQuery

I know that there are other ways of displaying a tooltip without the use of JQuery but I like the flexibility and control JQuery provides. This snippet shows how to add a tooltip to a Help icon.

  1. <!-- This sets up a button with a help icon next to it -->
  2. <input type="button" id="cascade" class="StandardButton" value="Cascade" />&nbsp;<img id="help" src="~/Images/help_icon.jpg" border="0" />
  4. <!-- This is the jquery code to add a tooltip to the help icon -->
  5. $(document).ready(function() {
  6. $('#help').tooltip(
  7. {
  8. delay: 0,
  9. bodyHandler: function() { return "Click this button to cascade your selection<br /> from its current level through all levels below."; },
  10. showURL: false
  11. })
  12. });

Report this snippet  

You need to login to post a comment.