Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

jQuery UI API - Tooltip Widget

jQuery UI API - Tooltip Widget

Category

Widgets

Usage

**Description:** A customizable, themeable tooltip that replaces the native tooltip.

**Version added:** 1.9

The tooltip replaces native tooltips, making them themeable and allowing for a variety of customizations:

By default, a fading animation is used to show and hide the tooltip, which looks more polished than simply toggling visibility. This can be customized through the show and hide option.

items and content options need to be kept in sync. If you change one, you need to change the other as well.

In general, disabled elements do not trigger any DOM events. Therefore, it is not possible to properly control tooltips on disabled elements, since we need to listen for events to decide when to show and hide the tooltip. As a result, jQuery UI cannot guarantee any level of support for tooltips attached to disabled elements. This means that if you need tooltips on disabled elements, you may need to use a mix of native tooltips and jQuery UI tooltips.

Theming

The Tooltip Widget uses jQuery UI CSS Framework to define the styles for its look and feel. To use the styles specific to the tooltip, you can use the following CSS class names:

- `ui-tooltip-content`: The content of the tooltip.

Depends on

Additional Notes

Example

Creates a tooltip on the document using event delegation for all elements with a title attribute.









  

  工具提示框部件(Tooltip Widget)演示

  

  

  





 

锚文本