1 |
<!doctype html> |
2 |
<html lang="en"> |
3 |
<head> |
4 |
<meta charset="utf-8"> |
5 |
<title>jQuery UI Tooltip - Track the mouse</title> |
6 |
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> |
7 |
<script src="../../jquery-1.9.1.js"></script> |
8 |
<script src="../../ui/jquery.ui.core.js"></script> |
9 |
<script src="../../ui/jquery.ui.widget.js"></script> |
10 |
<script src="../../ui/jquery.ui.position.js"></script> |
11 |
<script src="../../ui/jquery.ui.tooltip.js"></script> |
12 |
<link rel="stylesheet" href="../demos.css"> |
13 |
<style> |
14 |
label { |
15 |
display: inline-block; |
16 |
width: 5em; |
17 |
} |
18 |
</style> |
19 |
<script> |
20 |
$(function() { |
21 |
$( document ).tooltip({ |
22 |
track: true |
23 |
}); |
24 |
}); |
25 |
</script> |
26 |
</head> |
27 |
<body> |
28 |
|
29 |
<p><a href="#" title="That's what this widget is">Tooltips</a> can be attached to any element. When you hover |
30 |
the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip.</p> |
31 |
<p>But as it's not a native tooltip, it can be styled. Any themes built with |
32 |
<a href="http://themeroller.com" title="ThemeRoller: jQuery UI's theme builder application">ThemeRoller</a> |
33 |
will also style tooltips accordingly.</p> |
34 |
<p>Tooltips are also useful for form elements, to show some additional information in the context of each field.</p> |
35 |
<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes."></p> |
36 |
<p>Hover the field to see the tooltip.</p> |
37 |
|
38 |
<div class="demo-description"> |
39 |
<p>Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.</p> |
40 |
</div> |
41 |
</body> |
42 |
</html> |