diff options
Diffstat (limited to 'demos/menu/contextmenu.html')
-rw-r--r-- | demos/menu/contextmenu.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/demos/menu/contextmenu.html b/demos/menu/contextmenu.html index e031c2c4c..961cdd450 100644 --- a/demos/menu/contextmenu.html +++ b/demos/menu/contextmenu.html @@ -14,17 +14,17 @@ <link href="../demos.css" rel="stylesheet" /> <script> $(function() { - $(".demo button").button({ + var btn = $(".demo button").button({ icons: { primary: "ui-icon-home", secondary: "ui-icon-triangle-1-s" } - }).next().menu({ + }); + $("#cities").menu({ select: function(event, ui) { - $(this).hide(); $("#log").append("<div>Selected " + ui.item.text() + "</div>"); - } - }).popup(); + }, + trigger : btn}); }); </script> <style> @@ -36,7 +36,7 @@ <div class="demo"> <button>Select a city</button> - <ul> + <ul id="cities"> <li><a href="#Amsterdam">Amsterdam</a></li> <li><a href="#Anaheim">Anaheim</a></li> <li><a href="#Cologne">Cologne</a></li> |