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

jQuery UI Examples - Tooltip (Tooltip)

jQuery UI Examples - Tooltip (Tooltip)

Customizable, themeable tooltips that replace the native tooltips.

For more details about the tooltip widget, see the API documentation Tooltip Widget。

Default functionality

Hover over the links, or use the tab key to cycle focus through each element.









  

  jQuery UI 工具提示框(Tooltip) - 默认功能

  

  

  

  

  

  





 

Tooltips 可被绑定到任意的元素上。当您的鼠标悬停在元素上时,title 属性会显示在元素旁边的一个小框中,就像原生的工具提示框一样。

但是由于它不是一个原生的工具提示框,所以它可以被定义样式。通过 ThemeRoller 创建的主题也可以相应地定义工具提示框的样式。

工具提示框也可以用于表单元素,来显示每个区域中的一些额外的信息。

悬停在相应的区域上查看工具提示框。

Custom styling

Hover over the links, or use the tab key to cycle focus through each element.









  

  jQuery UI 工具提示框(Tooltip) - 自定义样式

  

  

  

  

  

  





 

Tooltips 可被绑定到任意的元素上。当您的鼠标悬停在元素上时,title 属性会显示在元素旁边的一个小框中,就像原生的工具提示框一样。

但是由于它不是一个原生的工具提示框,所以它可以被定义样式。通过 ThemeRoller 创建的主题也可以相应地定义工具提示框的样式。

工具提示框也可以用于表单元素,来显示每个区域中的一些额外的信息。

悬停在相应的区域上查看工具提示框。

Custom animation

This example shows how to use the show and hide options to customize the animation, and how to use the open event as well.









  

  jQuery UI 工具提示框(Tooltip) - 自定义动画

  

  

  

  

  





 

这里有多种方式自定义工具提示框的动画。

您可以使用 show 和 hide 选项。

您也可以使用 open 事件。

Custom content

Demonstrates how to combine different event-delegated tooltips into a single instance by customizing the items and content options.

You may need to interact with the map tooltip, which is a feature to be implemented in a future version.









  

  jQuery UI 工具提示框(Tooltip) - 自定义内容

  

  

  

  

  

  





 

圣史蒂芬大教堂(St. Stephen's Cathedral)

奥地利维也纳(Vienna, Austria)

St. Stephen's Cathedral

塔桥(Tower Bridge)

英国伦敦(London, England)

Tower Bridge

所有的图片源自 Wikimedia Commons,且归 CC BY-SA 3.0 下版权持有人所有。

The form

Use the buttons below to show the help text, or simply hover over an input or give it focus to display the help text for that input.

Define a fixed width in CSS so that displaying all the help text at once looks more consistent.









  

  jQuery UI 工具提示框(Tooltip) - 表单

  

  

  

  

  

  





 

Track the mouse

The tooltip in this example is positioned relative to the mouse and follows it as it moves over the element.









  

  jQuery UI 工具提示框(Tooltip) - 跟踪鼠标

  

  

  

  

  

  







Tooltips 可被绑定到任意的元素上。当您的鼠标悬停在元素上时,title 属性会显示在元素旁边的一个小框中,就像原生的工具提示框一样。

但是由于它不是一个原生的工具提示框,所以它可以被定义样式。通过 ThemeRoller 创建的主题也可以相应地定义工具提示框的样式。

工具提示框也可以用于表单元素,来显示每个区域中的一些额外的信息。

悬停在相应的区域上查看工具提示框。

Video player

A mock video player with like/share/stats buttons, each with a custom-styled tooltip.









  

  jQuery UI 工具提示框(Tooltip) - 视频播放器

  

  

  

  

  

  





 

这里是视频 (HTML5?)