2010-04-08 21:21:47 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<title>Tooltip Visual Test: Default</title>
|
|
|
|
<link rel="stylesheet" href="../visual.css" type="text/css" />
|
|
|
|
<link rel="stylesheet" href="../../../themes/base/jquery.ui.all.css" type="text/css">
|
2011-07-25 15:46:45 +00:00
|
|
|
<script type="text/javascript" src="../../../jquery-1.6.2.js"></script>
|
2010-04-08 21:21:47 +00:00
|
|
|
<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.button.js"></script>
|
|
|
|
<script type="text/javascript" src="../../../ui/jquery.ui.tooltip.js"></script>
|
2011-04-13 12:01:46 +00:00
|
|
|
<!--
|
2010-04-08 21:21:47 +00:00
|
|
|
<script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script>
|
2011-04-13 12:01:46 +00:00
|
|
|
-->
|
2010-04-08 21:21:47 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$.fn.themeswitcher && $('<div/>').css({
|
|
|
|
position: "absolute",
|
|
|
|
right: 10,
|
|
|
|
top: 10
|
|
|
|
}).appendTo(document.body).themeswitcher();
|
2011-04-13 12:01:46 +00:00
|
|
|
|
2010-04-08 21:21:47 +00:00
|
|
|
function enable() {
|
|
|
|
// default
|
2010-10-26 15:07:22 +00:00
|
|
|
$("#context1, form, #childish").tooltip();
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
// custom class, replaces ui-widget-content
|
2011-04-13 12:01:46 +00:00
|
|
|
$("#context2").tooltip({
|
|
|
|
tooltipClass: "ui-widget-header"
|
|
|
|
});
|
|
|
|
$("#right1").tooltip({
|
|
|
|
tooltipClass: "ui-state-error"
|
|
|
|
});
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
// synchronous content
|
2010-10-26 15:07:22 +00:00
|
|
|
$("#footnotes").tooltip({
|
2011-04-13 12:01:46 +00:00
|
|
|
items: "[href^='#']",
|
2010-04-08 21:21:47 +00:00
|
|
|
content: function() {
|
|
|
|
return $($(this).attr("href")).html();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
// asynchronous content
|
|
|
|
$("#ajax").tooltip({
|
|
|
|
content: function(response) {
|
|
|
|
$.get("ajaxcontent.php", response);
|
|
|
|
return "Loading...";
|
|
|
|
}
|
|
|
|
});
|
2010-10-21 19:03:48 +00:00
|
|
|
// asynchronous content with caching
|
|
|
|
var content;
|
|
|
|
$("#ajax2").tooltip({
|
|
|
|
content: function(response) {
|
|
|
|
if (content) {
|
|
|
|
return content;
|
|
|
|
}
|
|
|
|
$.ajax({
|
|
|
|
url: "ajaxcontent.php",
|
|
|
|
cache: false,
|
|
|
|
success: function(result) {
|
|
|
|
content = result;
|
|
|
|
response(result);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return "Loading...";
|
|
|
|
}
|
|
|
|
});
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
// custom position
|
|
|
|
$("#right2").tooltip({
|
2011-04-13 12:01:46 +00:00
|
|
|
tooltipClass: "ui-state-highlight",
|
2010-04-08 21:21:47 +00:00
|
|
|
position: {
|
|
|
|
my: "center top",
|
|
|
|
at: "center bottom",
|
|
|
|
offset: "0 10"
|
2010-10-26 13:36:43 +00:00
|
|
|
}
|
2011-04-13 12:01:46 +00:00
|
|
|
});
|
2010-04-08 21:21:47 +00:00
|
|
|
|
2010-10-26 15:07:22 +00:00
|
|
|
$("#button1").button();
|
2010-04-08 21:21:47 +00:00
|
|
|
$("#button2").button({
|
|
|
|
icons: {
|
|
|
|
primary: "ui-icon-wrench"
|
|
|
|
}
|
2010-10-26 15:07:22 +00:00
|
|
|
});
|
2010-05-15 14:37:52 +00:00
|
|
|
$("#button3, #button4").button({
|
2010-04-08 21:21:47 +00:00
|
|
|
icons: {
|
|
|
|
primary: "ui-icon-wrench"
|
|
|
|
},
|
|
|
|
text: false
|
2010-10-26 15:07:22 +00:00
|
|
|
});
|
|
|
|
$("#buttons").tooltip({
|
|
|
|
position: {
|
|
|
|
my: "center bottom",
|
|
|
|
at: "center top",
|
|
|
|
offset: "0 -5"
|
|
|
|
}
|
|
|
|
});
|
2010-04-08 21:21:47 +00:00
|
|
|
}
|
|
|
|
enable();
|
|
|
|
|
|
|
|
$("#disable").toggle(function() {
|
2011-04-13 12:01:46 +00:00
|
|
|
$(":ui-tooltip").tooltip("disable");
|
2010-04-08 21:21:47 +00:00
|
|
|
}, function() {
|
2011-04-13 12:01:46 +00:00
|
|
|
$(":ui-tooltip").tooltip("enable");
|
2010-04-08 21:21:47 +00:00
|
|
|
});
|
|
|
|
$("#toggle").toggle(function() {
|
2011-04-13 12:01:46 +00:00
|
|
|
$(":ui-tooltip").tooltip("destroy");
|
2010-04-08 21:21:47 +00:00
|
|
|
}, function() {
|
|
|
|
enable();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div style="width:300px">
|
|
|
|
<ul id="context1" class="ui-widget ui-widget-header">
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<div id="right1" style="position: absolute; right: 1em" title="right aligned element">
|
|
|
|
collision detection should kick in around here
|
|
|
|
</div>
|
|
|
|
|
2010-10-26 15:07:22 +00:00
|
|
|
<div id="footnotes" style="margin: 2em 0">
|
|
|
|
<a href="#footnote1">I'm a link to a footnote.</a>
|
|
|
|
<a href="#footnote2">I'm another link to a footnote.</a>
|
2010-04-08 21:21:47 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="right2" style="position: absolute; right: 1em" title="right aligned element with custom position">
|
|
|
|
right aligned with custom position
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="ajax" style="width: 100px;" class="ui-widget-content" title="never be seen">
|
|
|
|
gets its content via ajax
|
|
|
|
</div>
|
2010-10-21 19:03:48 +00:00
|
|
|
<div id="ajax2" style="width: 100px;" class="ui-widget-content" title="never be seen">
|
|
|
|
gets its content via ajax, caches the response
|
|
|
|
</div>
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
<div id="context2" class="ui-widget ui-widget-content">
|
|
|
|
<span title="something" style="border:1px solid blue">span</span>
|
|
|
|
<div title="something else" style="border:1px solid red;">
|
|
|
|
div
|
|
|
|
<span title="something more" style="border:1px solid green;">nested span</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="childish" class="ui-widget ui-widget-content" style="margin: 2em 0; border: 1px solid black;" title="element with child elements">
|
|
|
|
Text in <strong>bold</strong>.
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<form style="margin: 2em 0;">
|
|
|
|
<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>
|
|
|
|
|
2010-10-26 15:07:22 +00:00
|
|
|
<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>
|
2010-04-08 21:21:47 +00:00
|
|
|
|
2010-10-26 15:07:22 +00:00
|
|
|
<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-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
<button id="disable">Toggle disabled</button>
|
|
|
|
<button id="toggle">Toggle widget</button>
|
|
|
|
</div>
|
|
|
|
|
2010-05-15 14:37:52 +00:00
|
|
|
<div style="height: 2000px"></div>
|
2010-04-08 21:21:47 +00:00
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|