diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-03-21 22:28:32 +0100 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-03-21 22:28:32 +0100 |
commit | 7dbf7ecfc1d01bd23de1fa2785d58b8451e64f56 (patch) | |
tree | 5df02cd7d76d1dcc7c1a3951677a181590da2bb6 /tests/visual/tooltip/tooltip.html | |
parent | 05e31932a0667a2b2659f1a443827f98f9a194a3 (diff) | |
download | jquery-ui-7dbf7ecfc1d01bd23de1fa2785d58b8451e64f56.tar.gz jquery-ui-7dbf7ecfc1d01bd23de1fa2785d58b8451e64f56.zip |
Copying files from old Googlecode dev branch for tooltip
Diffstat (limited to 'tests/visual/tooltip/tooltip.html')
-rw-r--r-- | tests/visual/tooltip/tooltip.html | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html new file mode 100644 index 000000000..c0401be66 --- /dev/null +++ b/tests/visual/tooltip/tooltip.html @@ -0,0 +1,127 @@ +<!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"> + <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> + <script type="text/javascript" src="http://jqueryui.com/themeroller/themeswitchertool/"></script> + <script type="text/javascript"> + $(function() { + $.fn.themeswitcher && $('<div/>').css({ + position: "absolute", + right: 10, + top: 10 + }).appendTo(document.body).themeswitcher(); + + function enable() { + // default + $("#context1, form input").tooltip(); + + // custom class, replaces ui-widget-content + $("#context2").tooltip({ + tooltipClass: "ui-widget-header" + }); + $("#right1").tooltip({ + tooltipClass: "ui-state-error" + }); + + // synchronous content + $("#see-footnote").tooltip({ + content: function() { + return $($(this).attr("href")).html(); + } + }); + // asynchronous content + $("#ajax").tooltip({ + content: function(response) { + $.get("ajaxcontent.php", response); + return "Loading..."; + } + }); + + // custom position + $("#right2").tooltip({ + position: { + my: "center top", + at: "center bottom", + offset: "0 10" + }, + tooltipClass: "ui-state-highlight" + }); + } + enable(); + + $("#disable").toggle(function() { + $("*").tooltip("disable"); + }, function() { + $("*").tooltip("enable"); + }); + $("#toggle").toggle(function() { + $("*").tooltip("destroy"); + }, 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> + + <div style="margin: 2em 0"> + <a id="see-footnote" href="#footnote">I'm a link to a footnote.</a> + </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> + + <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> + + <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> + + <div id="footnote">This is <strong>the</strong> footnote, including other elements</div> + + <button id="disable">Toggle disabled</button> + <button id="toggle">Toggle widget</button> +</div> + + +</body> +</html> |