Skip to content

Commit a2674a2

Browse files
committed
Tooltip/Popup: Improve video-player demo
1 parent f7e8331 commit a2674a2

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

demos/tooltip/video-player.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,34 @@
1010
<script type="text/javascript" src="../../ui/jquery.ui.tooltip.js"></script>
1111
<script type="text/javascript" src="../../ui/jquery.ui.button.js"></script>
1212
<script type="text/javascript" src="../../ui/jquery.ui.menu.js"></script>
13+
<script type="text/javascript" src="../../ui/jquery.effects.core.js"></script>
14+
<script type="text/javascript" src="../../ui/jquery.effects.blind.js"></script>
1315
<script type="text/javascript" src="../../tests/visual/menu/popup.js"></script>
1416
<link type="text/css" href="../demos.css" rel="stylesheet" />
1517
<script type="text/javascript">
1618
$(function() {
1719
function notify( input ) {
1820
var msg = "Selected " + $.trim($(input).text());
19-
$("<div/>").appendTo(document.body).text(msg).addClass("notification ui-state-highlight").position({
20-
my: "center top+20",
21+
$("<div/>").appendTo(document.body).text(msg).addClass("notification ui-state-default ui-corner-bottom").position({
22+
my: "center top",
2123
at: "center top",
2224
of: window
23-
}).delay(1000).fadeOut("slow", function() {
25+
}).show({
26+
effect: "blind"
27+
}).delay(1000).hide({
28+
effect: "blind",
29+
duration: "slow"
30+
}, function() {
2431
$(this).remove();
2532
});
2633
}
2734
$("ul").menu({
2835
select: function(event, ui) {
29-
// stop button from handling the click
36+
// TODO stop button from handling the click
3037
$(this).popup("close");
38+
// TODO should probably be handled by poup, see ESCAPE key handler
39+
// affects key handling
40+
$(this).prev().focus();
3141
notify(ui.item);
3242
}
3343
}).popup();
@@ -75,7 +85,7 @@
7585

7686
.set { display: inline-block; }
7787

78-
.notification { position: absolute; display: inline-block; font-size: 2em; padding: 1em; border-radius: 15px; box-shadow: 2px 2px 5px -2px rgba(0,0,0,0.5); }
88+
.notification { position: absolute; display: inline-block; font-size: 2em; padding: .5em; box-shadow: 2px 2px 5px -2px rgba(0,0,0,0.5); }
7989
</style>
8090
</head>
8191
<body>

0 commit comments

Comments
 (0)