diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2014-04-24 14:02:09 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2014-04-24 14:02:09 +0200 |
commit | 67f564014a7e209fde1911b392ec60ce0109d7a9 (patch) | |
tree | 9b58da99223a08a1cd1b294527ae19f1e69e6b5d /demos/tooltip/video-player.html | |
parent | eefeaf0581188bb7d64d1407d36756e6a74d2744 (diff) | |
download | jquery-ui-67f564014a7e209fde1911b392ec60ce0109d7a9.tar.gz jquery-ui-67f564014a7e209fde1911b392ec60ce0109d7a9.zip |
Tooltip demo: Add a menu to the playlist button
Diffstat (limited to 'demos/tooltip/video-player.html')
-rw-r--r-- | demos/tooltip/video-player.html | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/demos/tooltip/video-player.html b/demos/tooltip/video-player.html index aee2cee2d..ce349d11e 100644 --- a/demos/tooltip/video-player.html +++ b/demos/tooltip/video-player.html @@ -28,6 +28,9 @@ background: rgba(20, 20, 20, 1); color: white; } + .ui-menu { + position: absolute; + } .set { display: inline-block; } @@ -71,7 +74,7 @@ }, text: !!$( this ).attr( "title" ) }); - button.click(function() { + button.not( ".menu" ).click(function() { notify( button ); }); }); @@ -79,6 +82,27 @@ items: "button" }); + $( "button.menu" ) + .click(function() { + $( document ).tooltip( "close", { currentTarget: this }); + var menu = $( this ).next().show().position({ + my: "left top", + at: "left bottom", + of: this + }); + $( document ).one( "click", function() { + menu.hide(); + }); + return false; + }) + .next() + .hide() + .menu({ + selected: function( event, ui ) { + notify( ui.item ); + } + }); + $( document ).tooltip({ position: { my: "center top", @@ -105,6 +129,12 @@ <div class="set"> <button data-icon="ui-icon-circle-plus" title="Add to Watch Later">Add to</button> <button class="menu" data-icon="ui-icon-triangle-1-s">Add to favorites or playlist</button> + <ul> + <li>Favorites</li> + <li>Funnees</li> + <li></li> + <li>New playlist...</li> + </ul> </div> <button title="Share this video">Share</button> <button data-icon="ui-icon-alert">Flag as inappropriate</button> |