menuicon.htm 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title></title>
  5. <link href="../../lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
  6. <link href="../../lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="../../lib/jquery/jquery-1.5.2.min.js" type="text/javascript"></script>
  8. <script src="../../lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  9. <script src="../../lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
  10. <script type="text/javascript">
  11. var menu;
  12. function onclick11(item, i)
  13. {
  14. alert(item.text);
  15. }
  16. function onclick112()
  17. {
  18. menu.hide();
  19. }
  20. $(function ()
  21. {
  22. menu = $.ligerMenu({ top: 100, left: 100, width: 120, items:
  23. [
  24. { text: '增加', click: onclick11,icon:'add' },
  25. { text: '修改', click: onclick11, icon: 'modify' },
  26. { line: true },
  27. { text: '查看', click: onclick11,icon:'show',children:
  28. [
  29. { text: '报表', click: onclick11,icon:'report' },
  30. { text: '导出', children: [{ text: 'Excel', click: onclick11 }, { text: 'Word'}]
  31. }
  32. ] },
  33. { text: '关闭', click: onclick112, icon: 'close' }
  34. ]
  35. });
  36. $(document).bind("contextmenu", function (e)
  37. {
  38. menu.show({ top: e.pageY, left: e.pageX });
  39. return false;
  40. });
  41. });
  42. </script>
  43. <style type="text/css">
  44. #menu1,.l-menu-shadow{top:30px; left:50px;}
  45. #menu1{ width:200px;}
  46. </style>
  47. </head>
  48. <body style="padding:20px; overflow:hidden; ">
  49. <div id="div1" style="width:400px; height:400px;">
  50. </div>
  51. </body>
  52. </html>