alignment.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Menu Alignment on MenuButton - 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>Menu Alignment on MenuButton</h2>
  14. <p>This example shows how to change the alignment of the top level menu.</p>
  15. <div style="margin:20px 0;">
  16. <span>Change Alignment: </span>
  17. <select onchange="setalign(this.value)">
  18. <option value="left">Left</option>
  19. <option value="right">Right</option>
  20. </select>
  21. </div>
  22. <div class="easyui-panel" style="padding:5px;">
  23. <a href="#" class="easyui-linkbutton" data-options="plain:true">Home</a>
  24. <a href="#" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-edit'">Edit</a>
  25. <a href="#" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-help'">Help</a>
  26. <a href="#" class="easyui-menubutton" data-options="menu:'#mm3'">About</a>
  27. </div>
  28. <div id="mm1" style="width:150px;">
  29. <div data-options="iconCls:'icon-undo'">Undo</div>
  30. <div data-options="iconCls:'icon-redo'">Redo</div>
  31. <div class="menu-sep"></div>
  32. <div>Cut</div>
  33. <div>Copy</div>
  34. <div>Paste</div>
  35. <div class="menu-sep"></div>
  36. <div>
  37. <span>Toolbar</span>
  38. <div>
  39. <div>Address</div>
  40. <div>Link</div>
  41. <div>Navigation Toolbar</div>
  42. <div>Bookmark Toolbar</div>
  43. <div class="menu-sep"></div>
  44. <div>New Toolbar...</div>
  45. </div>
  46. </div>
  47. <div data-options="iconCls:'icon-remove'">Delete</div>
  48. <div>Select All</div>
  49. </div>
  50. <div id="mm2" style="width:100px;">
  51. <div>Help</div>
  52. <div>Update</div>
  53. <div>About</div>
  54. </div>
  55. <div id="mm3">
  56. <div>History</div>
  57. <div>Faq</div>
  58. <div>Our Team</div>
  59. </div>
  60. <script>
  61. function setalign(align){
  62. $('a.easyui-menubutton').menubutton({
  63. menuAlign: align
  64. })
  65. }
  66. </script>
  67. </body>
  68. </html>