customitem.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Custom Menu Item - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Custom Menu Item</h2>
  14. <p>Right click on page to display menu, move to the 'Open' item to display its custom sub content.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div id="mm" style="width:120px;">
  17. <div>New</div>
  18. <div>
  19. <span>Open</span>
  20. <div class="menu-content" style="text-align:left;padding:10px">
  21. <div style="font-weight:bold;font-size:14px;margin-bottom:10px">Select Your Language:</div>
  22. <ul id="tt">
  23. <li>Java</li>
  24. <li>Basic</li>
  25. <li>C++</li>
  26. <li>Fortran</li>
  27. </ul>
  28. </div>
  29. </div>
  30. <div data-options="iconCls:'icon-save'">Save</div>
  31. <div data-options="iconCls:'icon-print'">Print</div>
  32. <div class="menu-sep"></div>
  33. <div>Exit</div>
  34. </div>
  35. <script>
  36. $(function(){
  37. $('#mm').menu();
  38. $('#tt').tree();
  39. $(document).bind('contextmenu',function(e){
  40. e.preventDefault();
  41. $('#mm').menu('show', {
  42. left: e.pageX,
  43. top: e.pageY
  44. });
  45. });
  46. });
  47. </script>
  48. </body>
  49. </html>