## Default Functionality
Hover over the links, or use the tab key to cycle focus through each element.
jQuery UI Tooltip - Default Functionality $(function() { $( document ).tooltip(); }); label { display: inline-block; width: 5em; }
Tooltips can be bound to any element. When you hover the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
But since it's not a native tooltip, it can be styled. Themes created with ThemeRoller can style the tooltips accordingly.
Tooltips can also be used for form elements, to show some extra information in each field.
Hover the field to see the tooltip.
## Custom Styling
Hover over the links, or use the tab key to cycle focus through each element.
jQuery UI Tooltip - Custom Styling $(function() { $( document ).tooltip({ position: { my: "center bottom-20", at: "center top", using: function( position, feedback ) { $( this ).css( position ); $( "
Tooltips can be bound to any element. When you hover the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.
But since it's not a native tooltip, it can be styled. Themes created with ThemeRoller can style the tooltips accordingly.
Tooltips can also be used for form elements, to show some extra information in each field.
Hover the field to see the tooltip.
## Custom Animation
This example demonstrates how to customize the animation using the show and hide options, as well as using the open event for custom animation.
jQuery UI Tooltip - Custom Animation $(function() { $( "#show-option" ).tooltip({ show: { effect: "slideDown", delay: 250 } }); $( "#hide-option" ).tooltip({ hide: { effect: "explode", delay: 250 } }); $( "#open-event" ).tooltip({ show: null, position: { my: "left top", at: "left bottom" }, open: function( event, ui ) { ui.tooltip.animate({ top: ui.tooltip.position().top + 10 }, "fast" ); } }); });
There are many ways to customize the tooltip animation.
## Custom Content
Demonstrates how to combine different event delegation tooltips into a single instance by customizing the items and content options.
You may need to interact with map tooltips, which is a feature to be implemented in a future version.
jQuery UI Tooltip - Custom Content .photo { width: 300px; text-align: center; } .photo .ui-widget-header { margin: 1em 0; } .map { width: 350px; height: 350px; } .ui-tooltip { max-width: 350px; } $(function() { $( document ).tooltip({ items: "img, , ", content: function() { var element = $( this ); if ( element.is( "" ) ) { var text = element.text(); return ""; } if ( element.is( "" ) ) { return element.attr( "title" ); } if ( element.is( "img" ) ) { return element.attr( "alt" ); } } }); });
## Form
Use the button below to show the help text, or just hover over or focus the input to show the help text for that input.
A fixed width is defined in the CSS to make all help texts appear consistent when shown simultaneously.
jQuery UI Tooltip - Form label { display: inline-block; width: 5em; } fieldset div { margin-bottom: 2em; } fieldset .help { display: inline-block; } .ui-tooltip { width: 210px; } $(function() { var tooltips = $( "" ).tooltip(); $( "