LigerUi之ligerMenu 右键菜单

<!DOCTYPE html>

<html>

 

    <head>

       <meta charset="UTF-8">

       <title></title>

       <link href="../skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

       <script type="text/javascript" src="../../js/jquery.js"></script>

       <script type="text/javascript" src="../js/ligerui.min.js"></script>

       <script type="text/javascript" src="../js/plugins/ligerMenu.js.js"></script>

       <script>

           var menu;

 

           function onclick11(item, i) {

              alert(item.text);

           }

 

           function onclick112() {

              menu.hide();

           }

           $(function() {

              menu = $.ligerMenu({

                  top: 100,

                  left: 100,

                  width: 120,

                  items: [{

                     text: '增加',

                     click: onclick11,

                     icon: 'add'

                  }, {

                     text: '修改',

                     click: onclick11

                  }, {

                     line: true

                  }, {

                     text: '查看',

                     click: onclick11,

                     children: [{

                         text: '报表',

                         click: onclick11

                     }, {

                         text: '导出',

                         children: [{

                            text: 'Excel',

                            click: onclick11

                         }, {

                            text: 'Word'

                         }]

                     }]

                  }, {

                     text: '关闭',

                     click: onclick112

                  }]

              });

 

              menu.show();

              $(document).bind("contextmenu", function(e) {

                            menu.show({

                                top: e.pageY,

                                left: e.pageX

                            });

                            return false;

                         });

           });

       </script>

 

       <style type="text/css">

           #menu1,

           .l-menu-shadow {

              top: 30px;

              left: 50px;

           }

          

           #menu1 {

              width: 200px;

           }

       </style>

    </head>

 

    <body>

       <div id="div1" style="width:400px; height:400px;"></div>

    </body>

 

</html>

猜你喜欢

转载自www.cnblogs.com/rdchen/p/10784544.html