Skip to content

Commit f270d48

Browse files
committed
Tooltip: Add video player demo
1 parent fe3b36b commit f270d48

File tree

2 files changed

+92
-1
lines changed

2 files changed

+92
-1
lines changed

demos/tooltip/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ <h4>Examples</h4>
1414
<li><a href="tracking.html">Track the mouse</a></li>
1515
<li><a href="custom-animation.html">Custom animation</a></li>
1616
<li><a href="delegation-mixbag.html">Delegation Mixbag</a></li>
17-
<li><a href="lots.html">Lots</a></li>
17+
<li><a href="video-player.html">Video Player</a></li>
1818
</ul>
1919
</div>
2020

demos/tooltip/video-player.html

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>jQuery UI Tooltip - Video Player demo</title>
5+
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
6+
<script type="text/javascript" src="../../jquery-1.5.1.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+
<script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
12+
<script type="text/javascript" src="../../ui/jquery.ui.menu.js"></script>
13+
<script type="text/javascript" src="../../tests/visual/menu/popup.js"></script>
14+
<link type="text/css" href="../demos.css" rel="stylesheet" />
15+
<script type="text/javascript">
16+
$(function() {
17+
$("button").each(function() {
18+
$(this).button({
19+
icons: {
20+
primary: $(this).data("icon")
21+
},
22+
text: !!$(this).attr("title")
23+
});
24+
});
25+
$(".set").buttonset();
26+
27+
// TODO hide the tooltip when clicking the button
28+
$("ul").menu().popup({
29+
trigger: $(".menu")
30+
});
31+
32+
$(".demo").tooltip({
33+
position: {
34+
my: "center top",
35+
at: "center bottom+5px"
36+
},
37+
// TODO need to merge tooltip-animations for this to work
38+
hide: false
39+
});
40+
});
41+
</script>
42+
<style>
43+
.player { width: 500px; height: 300px; border: 2px groove gray; background: rgb(200, 200, 200); text-align: center; line-height: 300px; }
44+
/* TODO load from jquery.ui.popup.css */
45+
.ui-popup { position: absolute; z-index: 5000; }
46+
</style>
47+
</head>
48+
<body>
49+
50+
<div class="demo">
51+
52+
<div class="player">Here Be Video (HTML5?)</div>
53+
<div class="tools">
54+
<span class="set">
55+
<button data-icon="ui-icon-circle-arrow-n" title="I like this">Like</button>
56+
<button data-icon="ui-icon-circle-arrow-s">I dislike this</button>
57+
</span>
58+
<span class="set">
59+
<button data-icon="ui-icon-circle-plus" title="Add to Watch Later">Add to</button>
60+
<button class="menu" data-icon="ui-icon-triangle-1-s">Add to favorites or playlist</button>
61+
</span>
62+
<button title="Share this video">Share</button>
63+
<button data-icon="ui-icon-alert">Flag as inappropiate</button>
64+
<ul>
65+
<li>
66+
<a href="#">Favorites</a>
67+
</li>
68+
<li>
69+
<a href="#">Watch Later</a>
70+
</li>
71+
<li>
72+
<a href="#">New Playlist...</a>
73+
</li>
74+
</ul>
75+
</div>
76+
</div>
77+
78+
</div><!-- End demo -->
79+
80+
81+
82+
<div class="demo-description">
83+
84+
<p>A fake video player with like/share/stats button, each with a tooltip.</p>
85+
86+
</div><!-- End demo-description -->
87+
88+
89+
90+
</body>
91+
</html>

0 commit comments

Comments
 (0)