5 <title>jQuery UI Tooltip - Custom content</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.tooltip.js"></script>
12 <link rel="stylesheet" href="../demos.css">
18 .photo .ui-widget-header {
31 $( document ).tooltip({
32 items: "img, [data-geo], [title]",
34 var element = $( this );
35 if ( element.is( "[data-geo]" ) ) {
36 var text = element.text();
37 return "<img class='map' alt='" + text +
38 "' src='http://maps.google.com/maps/api/staticmap?" +
39 "zoom=11&size=350x350&maptype=terrain&sensor=false¢er=" +
42 if ( element.is( "[title]" ) ) {
43 return element.attr( "title" );
45 if ( element.is( "img" ) ) {
46 return element.attr( "alt" );
55 <div class="ui-widget photo">
56 <div class="ui-widget-header ui-corner-all">
57 <h2>St. Stephen's Cathedral</h2>
58 <h3><a href="http://maps.google.com/maps?q=vienna,+austria&z=11" data-geo>Vienna, Austria</a></h3>
60 <a href="http://en.wikipedia.org/wiki/File:Wien_Stefansdom_DSC02656.JPG">
61 <img src="images/st-stephens.jpg" alt="St. Stephen's Cathedral" class="ui-corner-all">
65 <div class="ui-widget photo">
66 <div class="ui-widget-header ui-corner-all">
68 <h3><a href="http://maps.google.com/maps?q=london,+england&z=11" data-geo>London, England</a></h3>
70 <a href="http://en.wikipedia.org/wiki/File:Tower_bridge_London_Twilight_-_November_2006.jpg">
71 <img src="images/tower-bridge.jpg" alt="Tower Bridge" class="ui-corner-all">
75 <p>All images are part of <a href="http://commons.wikimedia.org/wiki/Main_Page">Wikimedia Commons</a>
76 and are licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.en" title="Creative Commons Attribution-ShareAlike 3.0">CC BY-SA 3.0</a> by the copyright holder.</p>
78 <div class="demo-description">
79 <p>Shows how to combine different event delegated tooltips into a single instance, by customizing the items and content options.</p>
80 <p>We realize you may want to interact with the map tooltips. This is a planned feature for a future version.</p>