|
| 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.2.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 | + <link type="text/css" href="../demos.css" rel="stylesheet" /> |
| 12 | + <script type="text/javascript"> |
| 13 | + $(function() { |
| 14 | + $(".demo").tooltip({ |
| 15 | + items: "[href], [title]", |
| 16 | + content: function(response) { |
| 17 | + var href = $(this).attr("href"); |
| 18 | + if (/^#/.test(href)) { |
| 19 | + return $(href).html(); |
| 20 | + } else if (href) { |
| 21 | + $.get(href, response); |
| 22 | + return "loading..."; |
| 23 | + } |
| 24 | + return this.title; |
| 25 | + } |
| 26 | + }); |
| 27 | + $("#footnotes").hide(); |
| 28 | + }); |
| 29 | + </script> |
| 30 | + <style> |
| 31 | + label { display: inline-block; width: 5em; } |
| 32 | + </style> |
| 33 | +</head> |
| 34 | +<body> |
| 35 | + |
| 36 | +<div class="demo"> |
| 37 | + <ul> |
| 38 | + <li> |
| 39 | + <a href="#footnote1">I'm a link to a footnote.</a> |
| 40 | + </li> |
| 41 | + <li> |
| 42 | + <a href="#footnote2">I'm another link to a footnote.</a> |
| 43 | + </li> |
| 44 | + </ul> |
| 45 | + <input title="This is just an input, nothing special" /> |
| 46 | + |
| 47 | + <ul> |
| 48 | + <li> |
| 49 | + <a href="ajax/content1.html">Link to ajax content, with tooltip preview!</a> |
| 50 | + </li> |
| 51 | + <li> |
| 52 | + <a href="ajax/content2.html">Another link to ajax content, with tooltip preview!</a> |
| 53 | + </li> |
| 54 | + </ul> |
| 55 | + |
| 56 | + <div id="footnotes"> |
| 57 | + <div id="footnote1">This is <strong>the</strong> footnote, including other elements</div> |
| 58 | + <div id="footnote2">This is <strong>the other</strong> footnote, including other elements</div> |
| 59 | + </div> |
| 60 | +</div><!-- End demo --> |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +<div class="demo-description"> |
| 65 | + |
| 66 | +<p>Show how to combine different event delegated tooltips into a single instance, by customizing the items and content options.</p> |
| 67 | + |
| 68 | +</div><!-- End demo-description --> |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +</body> |
| 73 | +</html> |
0 commit comments