jQuery Tooltip

jQuery Tooltip 插件取代了原生的工具提示框,让它们可自定义,您只需要调整它们的内容、位置和外观即可。

该插件目前版本是 1.3,已经很长时间没有更新,推荐使用 jQuery UI 工具提示框(Tooltip)

如需了解更多有关 jQuery UI 工具提示框(Tooltip)的细节,请查看 API 文档 jQuery UI 工具提示框部件(Tooltip Widget)

实例演示

jQuery Tooltip 插件演示。

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>jQuery UI Tooltip - Default functionality</title>
  6. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  7. <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  8. <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  9. <link rel="stylesheet" href="/resources/demos/style.css">
  10. <script>
  11. $(function() {
  12. $( document ).tooltip();
  13. });
  14. </script>
  15. <style>
  16. label {
  17. display: inline-block;
  18. width: 5em;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover
  24. the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.</p><p>But as it's not a native tooltip, it can be styled. Any themes built with<a href="http://jqueryui.com/themeroller/" title="ThemeRoller: jQuery UI's theme builder application">ThemeRoller</a>will also style tooltips accordingly.</p><p>Tooltips are also useful for form elements, to show some additional information in the context of each field.</p><p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes.">
  25. </p><p>Hover the field to see the tooltip.</p>
  26. </body>
  27. </html>

相关阅读

jQuery EasyUI 教程:jQuery EasyUI 基础插件 - Tooltip 提示框