2012-05-18 13:43:54 +00:00
|
|
|
<!doctype html>
|
2010-04-08 21:21:47 +00:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2012-04-23 16:44:17 +00:00
|
|
|
<meta charset="utf-8">
|
2010-04-08 21:21:47 +00:00
|
|
|
<title>Tooltip Visual Test: Default</title>
|
2013-12-02 18:36:12 +00:00
|
|
|
<link rel="stylesheet" href="../../../themes/base/all.css">
|
2012-05-18 13:43:54 +00:00
|
|
|
<style>
|
|
|
|
.group {
|
|
|
|
margin-top: 2em;
|
|
|
|
}
|
|
|
|
</style>
|
2015-09-30 07:49:13 +00:00
|
|
|
<script src="../../../external/requirejs/require.js"></script>
|
|
|
|
<script src="../../../demos/bootstrap.js" data-modules="button">
|
2012-05-18 13:43:54 +00:00
|
|
|
// default
|
|
|
|
$( "#context1, form, #childish, #nested-input" ).tooltip();
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2015-08-21 04:04:13 +00:00
|
|
|
// Custom class, replaces ui-widget-content
|
2012-05-18 13:43:54 +00:00
|
|
|
$( "#context2" ).tooltip({
|
2014-12-03 16:30:22 +00:00
|
|
|
classes: {
|
|
|
|
"ui-tooltip": "ui-corner-all ui-widget-header"
|
|
|
|
}
|
2012-05-18 13:43:54 +00:00
|
|
|
});
|
|
|
|
$( "#right1" ).tooltip({
|
2014-12-03 16:30:22 +00:00
|
|
|
classes: {
|
|
|
|
"ui-tooltip": "ui-corner-all ui-state-error"
|
|
|
|
}
|
2012-05-18 13:43:54 +00:00
|
|
|
});
|
|
|
|
|
2015-08-21 04:04:13 +00:00
|
|
|
// Synchronous content
|
2012-05-18 13:43:54 +00:00
|
|
|
$( "#footnotes" ).tooltip({
|
|
|
|
items: "[href^='#']",
|
|
|
|
content: function() {
|
|
|
|
return $( $( this ).attr( "href" ) ).html();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-08-21 04:04:13 +00:00
|
|
|
// Asynchronous content
|
2012-05-18 13:43:54 +00:00
|
|
|
$( "#async" ).tooltip({
|
|
|
|
content: function( response ) {
|
|
|
|
setTimeout(function() {
|
2012-09-06 01:37:29 +00:00
|
|
|
response( "I loaded <strong>asynchronously</strong>!" );
|
2012-05-18 13:43:54 +00:00
|
|
|
}, 1000 );
|
|
|
|
return "Loading...";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-08-21 04:04:13 +00:00
|
|
|
// Asynchronous content with caching
|
2012-05-18 13:43:54 +00:00
|
|
|
var content;
|
|
|
|
$( "#async2" ).tooltip({
|
|
|
|
content: function( response ) {
|
|
|
|
if ( content ) {
|
|
|
|
return content;
|
2010-10-26 15:07:22 +00:00
|
|
|
}
|
2012-05-18 13:43:54 +00:00
|
|
|
setTimeout(function() {
|
|
|
|
content = "<strong>Hello</strong> world!";
|
|
|
|
response( content );
|
|
|
|
}, 1000 );
|
|
|
|
return "Loading...";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-08-21 04:04:13 +00:00
|
|
|
// Custom position
|
2012-05-18 13:43:54 +00:00
|
|
|
$( "#right2" ).tooltip({
|
2014-12-03 16:30:22 +00:00
|
|
|
classes: {
|
|
|
|
"ui-tooltip": "ui-corner-all ui-state-highlight"
|
|
|
|
},
|
2012-05-18 13:43:54 +00:00
|
|
|
position: {
|
|
|
|
my: "center top",
|
2012-10-25 10:39:14 +00:00
|
|
|
at: "center bottom+10"
|
2012-05-18 13:43:54 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$( "#button1" ).button();
|
|
|
|
$( "#button2" ).button({
|
2024-09-30 16:05:22 +00:00
|
|
|
icon: "ui-icon-wrench"
|
2012-05-18 13:43:54 +00:00
|
|
|
});
|
|
|
|
$( "#button3, #button4" ).button({
|
2024-09-30 16:05:22 +00:00
|
|
|
icon: "ui-icon-wrench",
|
|
|
|
showLabel: false
|
2010-04-08 21:21:47 +00:00
|
|
|
});
|
2012-05-18 13:43:54 +00:00
|
|
|
$( "#buttons" ).tooltip({
|
|
|
|
position: {
|
|
|
|
my: "center bottom",
|
2012-10-25 10:39:14 +00:00
|
|
|
at: "center top-5"
|
2012-05-18 13:43:54 +00:00
|
|
|
}
|
2010-04-08 21:21:47 +00:00
|
|
|
});
|
2012-10-19 22:16:11 +00:00
|
|
|
|
2012-10-16 16:55:50 +00:00
|
|
|
$( "#blurs-on-click" ).tooltip({
|
|
|
|
track: true,
|
|
|
|
show: {
|
|
|
|
delay: 500
|
|
|
|
}
|
2015-05-14 02:02:14 +00:00
|
|
|
}).on( "click", function() {
|
|
|
|
$( "#focus-on-me" ).trigger( "focus" );
|
2012-10-19 22:16:11 +00:00
|
|
|
});
|
2010-04-08 21:21:47 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div>
|
|
|
|
<p>Lots of tooltipped elements close together.<br>
|
|
|
|
Mouse through them quickly and slowly.</p>
|
|
|
|
<ul id="context1">
|
2010-04-08 21:21:47 +00:00
|
|
|
<li><a href="#" title="Tooltip text 1">Anchor 1</a></li>
|
|
|
|
<li><a href="#" title="Tooltip text 2">Anchor 2</a></li>
|
|
|
|
<li><a href="#" title="Tooltip text 3">Anchor 3</a></li>
|
|
|
|
<li><a href="#" title="Tooltip text 4 more Tooltip text Tooltip text ">Anchor 4</a></li>
|
|
|
|
<li><a href="#" title="Tooltip text 5 more Tooltip text Tooltip text ">Anchor 5</a></li>
|
|
|
|
<li><a href="#" title="Tooltip text 6 more Tooltip text Tooltip text ">Anchor 6</a></li>
|
|
|
|
</ul>
|
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group" style="position: absolute; right: 1em; text-align: right;">
|
|
|
|
<p>These elements are right aligned.<br>
|
|
|
|
One collides and one uses custom position.</p>
|
|
|
|
<p id="right1" title="right aligned element">
|
|
|
|
collision detection should kick in around here
|
|
|
|
</p>
|
|
|
|
<p id="right2" title="right aligned element with custom position">
|
|
|
|
right aligned with custom position
|
|
|
|
</p>
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group">
|
|
|
|
<p>These footnotes pull content form the elements they link to.</p>
|
|
|
|
<div id="footnotes">
|
|
|
|
<a href="#footnote1">I'm a link to a footnote.</a>
|
|
|
|
<a href="#footnote2">I'm another link to a footnote.</a>
|
|
|
|
</div>
|
2010-10-21 19:03:48 +00:00
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group">
|
|
|
|
<p>These elements load their content asynchronously.<br>
|
|
|
|
There should be a loading message while the content is retrieved.</p>
|
|
|
|
<div id="async" style="width: 100px;" class="ui-widget-content" title="never be seen">
|
|
|
|
async
|
|
|
|
</div>
|
|
|
|
<div id="async2" style="width: 100px;" class="ui-widget-content" title="never be seen">
|
|
|
|
async + cache
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group" style="width: 300px;">
|
|
|
|
<p>Nested elements.</p>
|
|
|
|
<div id="context2">
|
2012-10-20 00:58:08 +00:00
|
|
|
<div title="nested parent" style="border:1px solid red;">
|
2012-05-18 13:43:54 +00:00
|
|
|
tooltipped
|
2012-10-20 00:58:08 +00:00
|
|
|
<span title="nested child" style="border:1px solid green; padding-left: 25px;">
|
|
|
|
nested tooltipped
|
|
|
|
<span title="nested nested child" style="border:1px solid blue; padding-left: 25px;">third level</span>
|
|
|
|
</span>
|
2012-05-18 13:43:54 +00:00
|
|
|
</div>
|
2012-10-20 00:58:08 +00:00
|
|
|
<input title="nested input title">
|
2012-05-18 13:43:54 +00:00
|
|
|
</div>
|
|
|
|
<div id="childish" style="border: 1px solid black;" title="element with child elements">
|
|
|
|
Text in <strong>bold</strong>.
|
|
|
|
</div>
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2012-10-19 22:16:11 +00:00
|
|
|
<button id="blurs-on-click" title="button title text">click me to focus something else</button>
|
|
|
|
<input id="focus-on-me">
|
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group">
|
|
|
|
<p>Play around with focusing and hovering of form elements.</p>
|
|
|
|
<form>
|
|
|
|
<div>
|
|
|
|
<label for="first">First Name:</label>
|
|
|
|
<input id="first" title="Your first name is optional">
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label for="last">Last Name:</label>
|
|
|
|
<input id="last" title="Your last name is optional">
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<p>Some inputs nested inside labels:</p>
|
|
|
|
<div id="nested-input">
|
|
|
|
<label title="test"><input type="checkbox">This is a test</label>
|
|
|
|
<label title="test2"><input type="checkbox">This is a test</label>
|
|
|
|
<label><input type="checkbox" title="test3">This is a test</label>
|
|
|
|
<label><input type="checkbox" title="test4">This is a test</label>
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<p>Some button widgets:</p>
|
|
|
|
<div id="buttons">
|
|
|
|
<button id="button1" title="Button Tooltip">Button Label</button>
|
|
|
|
<button id="button2" title="Icon Button">Button with Icon</button>
|
|
|
|
<button id="button3">Icon Only Button 1</button>
|
|
|
|
<button id="button4">Icon Only Button 2</button>
|
|
|
|
</div>
|
2012-02-23 18:37:31 +00:00
|
|
|
</div>
|
|
|
|
|
2012-05-18 13:43:54 +00:00
|
|
|
<div class="group">
|
|
|
|
<div id="footnote1">This is <strong>the</strong> footnote, including other elements</div>
|
|
|
|
<div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div>
|
2010-10-26 15:07:22 +00:00
|
|
|
</div>
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
|
|
|
|
2010-05-15 14:37:52 +00:00
|
|
|
<div style="height: 2000px"></div>
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|