1 |
<!doctype html> |
2 |
<html lang="en"> |
3 |
<head> |
4 |
<meta charset="utf-8"> |
5 |
<title>jQuery UI Tooltip - Video Player demo</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 |
<script src="../../ui/jquery.ui.button.js"></script> |
13 |
<script src="../../ui/jquery.ui.menu.js"></script> |
14 |
<script src="../../ui/jquery.ui.effect.js"></script> |
15 |
<script src="../../ui/jquery.ui.effect-blind.js"></script> |
16 |
<link rel="stylesheet" href="../demos.css"> |
17 |
<style> |
18 |
.player { |
19 |
width: 500px; |
20 |
height: 300px; |
21 |
border: 2px groove gray; |
22 |
background: rgb(200, 200, 200); |
23 |
text-align: center; |
24 |
line-height: 300px; |
25 |
} |
26 |
.ui-tooltip { |
27 |
border: 1px solid white; |
28 |
background: rgba(20, 20, 20, 1); |
29 |
color: white; |
30 |
} |
31 |
.set { |
32 |
display: inline-block; |
33 |
} |
34 |
.notification { |
35 |
position: absolute; |
36 |
display: inline-block; |
37 |
font-size: 2em; |
38 |
padding: .5em; |
39 |
box-shadow: 2px 2px 5px -2px rgba(0,0,0,0.5); |
40 |
} |
41 |
</style> |
42 |
<script> |
43 |
$(function() { |
44 |
function notify( input ) { |
45 |
var msg = "Selected " + $.trim( input.data( "tooltip-title" ) || input.text() ); |
46 |
$( "<div>" ) |
47 |
.appendTo( document.body ) |
48 |
.text( msg ) |
49 |
.addClass( "notification ui-state-default ui-corner-bottom" ) |
50 |
.position({ |
51 |
my: "center top", |
52 |
at: "center top", |
53 |
of: window |
54 |
}) |
55 |
.show({ |
56 |
effect: "blind" |
57 |
}) |
58 |
.delay( 1000 ) |
59 |
.hide({ |
60 |
effect: "blind", |
61 |
duration: "slow" |
62 |
}, function() { |
63 |
$( this ).remove(); |
64 |
}); |
65 |
} |
66 |
|
67 |
$( "button" ).each(function() { |
68 |
var button = $( this ).button({ |
69 |
icons: { |
70 |
primary: $( this ).data( "icon" ) |
71 |
}, |
72 |
text: !!$( this ).attr( "title" ) |
73 |
}); |
74 |
button.click(function() { |
75 |
notify( button ); |
76 |
}); |
77 |
}); |
78 |
$( ".set" ).buttonset({ |
79 |
items: "button" |
80 |
}); |
81 |
|
82 |
$( document ).tooltip({ |
83 |
position: { |
84 |
my: "center top", |
85 |
at: "center bottom+5", |
86 |
}, |
87 |
show: { |
88 |
duration: "fast" |
89 |
}, |
90 |
hide: { |
91 |
effect: "hide" |
92 |
} |
93 |
}); |
94 |
}); |
95 |
</script> |
96 |
</head> |
97 |
<body> |
98 |
|
99 |
<div class="player">Here Be Video (HTML5?)</div> |
100 |
<div class="tools"> |
101 |
<span class="set"> |
102 |
<button data-icon="ui-icon-circle-arrow-n" title="I like this">Like</button> |
103 |
<button data-icon="ui-icon-circle-arrow-s">I dislike this</button> |
104 |
</span> |
105 |
<div class="set"> |
106 |
<button data-icon="ui-icon-circle-plus" title="Add to Watch Later">Add to</button> |
107 |
<button class="menu" data-icon="ui-icon-triangle-1-s">Add to favorites or playlist</button> |
108 |
</div> |
109 |
<button title="Share this video">Share</button> |
110 |
<button data-icon="ui-icon-alert">Flag as inappropiate</button> |
111 |
</div> |
112 |
|
113 |
<div class="demo-description"> |
114 |
<p>A fake video player with like/share/stats button, each with a custom-styled tooltip.</p> |
115 |
</div> |
116 |
</body> |
117 |
</html> |