Menu
Themetable menu for navigation with mouse and keyboard interaction.
For more details about the menu widget, please view the API documentation Menu Widget.
Default Function
A menu with default configuration, disabled entries and nested menus. Converted from a list, added with themes, and supports mouse and keyboard interaction. Try using the cursor keys to navigate the menu.
Instance
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI 菜单(Menu) - 默认功能</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css"> <script> $(function() { $( "#menu" ).menu(); }); </script> <style> .ui-menu { width: 150px; } </style> </head> <body> <ul id="menu"> <li class="ui-state-disabled"><a href="#">Aberdeen</a></li> <li><a href="#">Ada</a></li> <li><a href="#">Adamsville</a></li> <li><a href="#">Addyston</a></li> <li> <a href="#">Delphi</a> <ul> <li class="ui-state-disabled"><a href="#">Ada</a></li> <li><a href="#">Saarland</a></li> <li><a href="#">Salzburg</a></li> </ul> </li> <li><a href="#">Saarland</a></li> <li> <a href="#">Salzburg</a> <ul> <li> <a href="#">Delphi</a> <ul> <li><a href="#">Ada</a></li> <li><a href="#">Saarland</a></li> <li><a href="#">Salzburg</a></li> </ul> </li> <li> <a href="#">Delphi</a> <ul> <li><a href="#">Ada</a></li> <li><a href="#">Saarland</a></li> <li><a href="#">Salzburg</a></li> </ul> </li> <li><a href="#">Perch</a></li> </ul> </li> <li class="ui-state-disabled"><a href="#">Amesville</a></li> </ul> </body> </html>
Run instance»
Click the "Run instance" button to view the online instance
Icons
A menu with a default configuration showing how to use the menu with icons.
Instance
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI 菜单(Menu) - 图标</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="http://jqueryui.com/resources/demos/style.css"> <script> $(function() { $( "#menu" ).menu(); }); </script> <style> .ui-menu { width: 150px; } </style> </head> <body> <ul id="menu"> <li><a href="#"><span class="ui-icon ui-icon-disk"></span>保存</a></li> <li><a href="#"><span class="ui-icon ui-icon-zoomin"></span>放大</a></li> <li><a href="#"><span class="ui-icon ui-icon-zoomout"></span>缩小</a></li> <li class="ui-state-disabled"><a href="#"><span class="ui-icon ui-icon-print"></span>打印...</a></li> <li> <a href="#">播放</a> <ul> <li><a href="#"><span class="ui-icon ui-icon-seek-start"></span>上一个</a></li> <li><a href="#"><span class="ui-icon ui-icon-stop"></span>停止</a></li> <li><a href="#"><span class="ui-icon ui-icon-play"></span>播放</a></li> <li><a href="#"><span class="ui-icon ui-icon-seek-end"></span>下一个</a></li> </ul> </li> </ul> </body> </html>
Run instance»
Click the "Run instance" button to view the online instance