diff options
Diffstat (limited to 'tests/visual/menu/menu.html')
-rw-r--r-- | tests/visual/menu/menu.html | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/tests/visual/menu/menu.html b/tests/visual/menu/menu.html index 2380e5a29..6388b1053 100644 --- a/tests/visual/menu/menu.html +++ b/tests/visual/menu/menu.html @@ -17,12 +17,25 @@ top: 10 }).appendTo(document.body).themeswitcher(); - $("#menu1, #menu2").menu({ - select: function(event, ui) { - $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log"); - } - }); + function create() { + menus.menu({ + select: function(event, ui) { + $("<div/>").text("Selected: " + ui.item.text()).appendTo("#log"); + } + }); + } + + var menus = $("#menu1, #menu2"); + create(); + $("#toggle-destroy").toggle(function() { + menus.menu("destroy"); + }, create); + $("#toggle-disable").toggle(function() { + menus.menu("disable"); + }, function() { + menus.menu("enable"); + }); }); </script> <style> @@ -87,5 +100,8 @@ <div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div> </div> +<button id="toggle-disable">Disable / Enable</button> +<button id="toggle-destroy">Destroy / Create</button> + </body> </html> |