5 <title>Tooltip Visual Test: Default</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.button.js"></script>
12 <script src="../../../ui/jquery.ui.tooltip.js"></script>
21 $( "#context1, form, #childish, #nested-input" ).tooltip();
23 // custom class, replaces ui-widget-content
24 $( "#context2" ).tooltip({
25 tooltipClass: "ui-widget-header"
27 $( "#right1" ).tooltip({
28 tooltipClass: "ui-state-error"
31 // synchronous content
32 $( "#footnotes" ).tooltip({
35 return $( $( this ).attr( "href" ) ).html();
39 // asynchronous content
40 $( "#async" ).tooltip({
41 content: function( response ) {
42 setTimeout(function() {
43 response( "I loaded <strong>asynchronously</strong>!" );
49 // asynchronous content with caching
51 $( "#async2" ).tooltip({
52 content: function( response ) {
56 setTimeout(function() {
57 content = "<strong>Hello</strong> world!";
65 $( "#right2" ).tooltip({
66 tooltipClass: "ui-state-highlight",
69 at: "center bottom+10"
73 $( "#button1" ).button();
74 $( "#button2" ).button({
76 primary: "ui-icon-wrench"
79 $( "#button3, #button4" ).button({
81 primary: "ui-icon-wrench"
85 $( "#buttons" ).tooltip({
92 $( "#blurs-on-click" ).tooltip({
98 $( "#focus-on-me" ).focus();
106 <p>Lots of tooltipped elements close together.<br>
107 Mouse through them quickly and slowly.</p>
109 <li><a href="#" title="Tooltip text 1">Anchor 1</a></li>
110 <li><a href="#" title="Tooltip text 2">Anchor 2</a></li>
111 <li><a href="#" title="Tooltip text 3">Anchor 3</a></li>
112 <li><a href="#" title="Tooltip text 4 more Tooltip text Tooltip text ">Anchor 4</a></li>
113 <li><a href="#" title="Tooltip text 5 more Tooltip text Tooltip text ">Anchor 5</a></li>
114 <li><a href="#" title="Tooltip text 6 more Tooltip text Tooltip text ">Anchor 6</a></li>
117 <div class="group" style="position: absolute; right: 1em; text-align: right;">
118 <p>These elements are right aligned.<br>
119 One collides and one uses custom position.</p>
120 <p id="right1" title="right aligned element">
121 collision detection should kick in around here
123 <p id="right2" title="right aligned element with custom position">
124 right aligned with custom position
129 <p>These footnotes pull content form the elements they link to.</p>
131 <a href="#footnote1">I'm a link to a footnote.</a>
132 <a href="#footnote2">I'm another link to a footnote.</a>
137 <p>These elements load their content asynchronously.<br>
138 There should be a loading message while the content is retrieved.</p>
139 <div id="async" style="width: 100px;" class="ui-widget-content" title="never be seen">
142 <div id="async2" style="width: 100px;" class="ui-widget-content" title="never be seen">
147 <div class="group" style="width: 300px;">
148 <p>Nested elements.</p>
150 <div title="nested parent" style="border:1px solid red;">
152 <span title="nested child" style="border:1px solid green; padding-left: 25px;">
154 <span title="nested nested child" style="border:1px solid blue; padding-left: 25px;">third level</span>
157 <input title="nested input title">
159 <div id="childish" style="border: 1px solid black;" title="element with child elements">
160 Text in <strong>bold</strong>.
164 <button id="blurs-on-click" title="button title text">click me to focus something else</button>
165 <input id="focus-on-me">
168 <p>Play around with focusing and hovering of form elements.</p>
171 <label for="first">First Name:</label>
172 <input id="first" title="Your first name is optional">
175 <label for="last">Last Name:</label>
176 <input id="last" title="Your last name is optional">
180 <p>Some inputs nested inside labels:</p>
181 <div id="nested-input">
182 <label title="test"><input type="checkbox">This is a test</label>
183 <label title="test2"><input type="checkbox">This is a test</label>
184 <label><input type="checkbox" title="test3">This is a test</label>
185 <label><input type="checkbox" title="test4">This is a test</label>
188 <p>Some button widgets:</p>
190 <button id="button1" title="Button Tooltip">Button Label</button>
191 <button id="button2" title="Icon Button">Button with Icon</button>
192 <button id="button3">Icon Only Button 1</button>
193 <button id="button4">Icon Only Button 2</button>
198 <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div>
199 <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div>
203 <div style="height: 2000px"></div>