|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <title>jQuery UI Tooltip - Default demo</title> |
| 5 | + <link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" /> |
| 6 | + <script type="text/javascript" src="../../jquery-1.4.4.js"></script> |
| 7 | + <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script> |
| 8 | + <script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script> |
| 9 | + <script type="text/javascript" src="../../ui/jquery.ui.position.js"></script> |
| 10 | + <script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script> |
| 11 | + <script type="text/javascript" src="../../ui/jquery.ui.button.js"></script> |
| 12 | + <link type="text/css" href="../demos.css" rel="stylesheet" /> |
| 13 | + <script type="text/javascript"> |
| 14 | + $(function() { |
| 15 | + $("[title]").tooltip().unbind(".tooltip"); |
| 16 | + $("<button/>").text("Show help").button().toggle(function() { |
| 17 | + $(":ui-tooltip").tooltip("open"); |
| 18 | + }, function() { |
| 19 | + $(":ui-tooltip").tooltip("close"); |
| 20 | + }).appendTo("form"); |
| 21 | + }); |
| 22 | + </script> |
| 23 | + <style> |
| 24 | + label { display: inline-block; width: 5em; } |
| 25 | + .ui-icon { display: inline-block; } |
| 26 | + fieldset div { |
| 27 | + margin-bottom: 2em; |
| 28 | + } |
| 29 | + .ui-tooltip { width: 210px; } |
| 30 | + </style> |
| 31 | +</head> |
| 32 | +<body> |
| 33 | + |
| 34 | +<div class="demo"> |
| 35 | + |
| 36 | + <form> |
| 37 | + <fieldset> |
| 38 | + <div> |
| 39 | + <label for="firstname">Firstname</label> |
| 40 | + <input id="firstname" name="firstname" /> |
| 41 | + <span title="Please provide your firstname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span> |
| 42 | + </div> |
| 43 | + <div> |
| 44 | + <label for="lastname">Lastname</label> |
| 45 | + <input id="lastname" name="lastname" /> |
| 46 | + <span title="Please provide also your lastname." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span> |
| 47 | + </div> |
| 48 | + <div> |
| 49 | + <label for="address">Address</label> |
| 50 | + <input id="address" name="address" /> |
| 51 | + <span title="Your home or work address." class="ui-state-default ui-corner-all ui-icon ui-icon-help">?</span> |
| 52 | + </div> |
| 53 | + </fieldset> |
| 54 | + </form> |
| 55 | + |
| 56 | +</div><!-- End demo --> |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +<div class="demo-description"> |
| 61 | + |
| 62 | +<p>Use the button below to display the help texts. Click again to hide them. Default hover and focus events are removed to show tooltip only programmatically.</p> |
| 63 | + |
| 64 | +<p>A fixed width is defined in CSS to make the tooltips look consistent when displayed all at once.</p> |
| 65 | + |
| 66 | +</div><!-- End demo-description --> |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +</body> |
| 71 | +</html> |
0 commit comments