小部件菜单功能可与JqueryUI中的小部件一起使用。一个简单的菜单显示项目列表。
Menu - 语法
$( "#menu" ).menu();
Menu - 示例
以下是显示菜单用法的简单示例-
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Menu - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"> </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"> </script> <script> $(function() { $( "#menu" ).menu(); }); </script> <style> .ui-menu { width: 150px; } </style> </head> <body> <ul id="menu"> <li class="ui-state-disabled">Team</li> <li>Gopal K verma</li> <li>Omer</li> <li>Khaleel</li> <li>Prasanth <ul> <li class="ui-state-disabled">Krishna</li> <li>Raju</li> <li>Sairamkrishna </li> </ul> </li> <li>Vineeth</li> <li>Rajeev <ul> <li>Lakshmi <ul> <li>Kiran</li> <li>Sai</li> <li>Javeed</li> </ul> </li> <li>Raju <ul> <li>Arshad</li> <li>Johar</li> <li>Althamas</li> </ul> </li> <li>Gopal</li> </ul> </li> <li class="ui-state-disabled">Santosh</li> </ul> </body> </html>
这将产生以下输出-
参考链接
https://www.learnfk.com/jquery/widget-menu.html
标签:jQuery,菜单,示例,Menu,无涯,menu,Gopal From: https://blog.51cto.com/u_14033984/6899472