diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-08 23:21:47 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-08 23:21:47 +0200 |
commit | 6204e1a3c4197d4c612e786337ee371295364ee2 (patch) | |
tree | 48130743e10e7fb1925ae62ba497030f46256421 /demos/tooltip/tracking.html | |
parent | 9230b7263b90dfc3fcb4a309b549332dee6dcba4 (diff) | |
download | jquery-ui-6204e1a3c4197d4c612e786337ee371295364ee2.tar.gz jquery-ui-6204e1a3c4197d4c612e786337ee371295364ee2.zip |
The accidental merge of tooltip into master was reverted in master, that revert got merged back into tooltip; now reverting that revert to get the tooltip stuff back, should then make it easy to merge into master once tooltip is done
Diffstat (limited to 'demos/tooltip/tracking.html')
-rw-r--r-- | demos/tooltip/tracking.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/demos/tooltip/tracking.html b/demos/tooltip/tracking.html new file mode 100644 index 000000000..9af4d0d09 --- /dev/null +++ b/demos/tooltip/tracking.html @@ -0,0 +1,65 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Tooltip - Default demo</title> + <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.4.2.js"></script> + <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> + <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> + <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script> + <script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <script type="text/javascript"> + $(function() { + $("a, input").tooltip({ + open: function() { + var tooltip = $(this).tooltip("widget"); + $(document).mousemove(function(event) { + tooltip.position({ + my: "left center", + at: "right center", + offset: "25 25", + of: event + }); + }) + // trigger once to override element-relative positioning + .mousemove(); + }, + close: function() { + $(document).unbind("mousemove"); + } + }); + }); + </script> + <style> + label { display: inline-block; width: 5em; } + </style> +</head> +<body> + +<div class="demo"> + + <p><a href="#" title="That's what this widget is">Tooltips</a> can be attached 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. + </p> + <p>But as it's not a native tooltip, it can be styled. Any themes built with + <a href="http://themeroller.com" title="ThemeRoller, jQuery UI's theme builder application">ThemeRoller</a> + will also style tooltip's accordingly.</p> + <p>Tooltip's 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." /></p> + <p>Click the field to see the tooltip; when you tab out of the field, it gets hidden.</p> + +</div><!-- End demo --> + + + +<div class="demo-description"> + +<p>Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.</p> + +</div><!-- End demo-description --> + + + +</body> +</html> |