1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | $( "#aaa" ).NZ_Menu({ items: [{ name: "复制" , event: aas }, { name: "粘贴" , event: function () { alert( "粘贴" ); } }, { name: "粘贴" , event: function () { alert( "粘贴" ); } }, { name: "粘贴" , event: function () { alert( "粘贴" ); }, { name: "This item is Test" , event: function () { } } }] }); function aas() { alert( "复制" ); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | $( "#bbb" ).NZ_Menu({ items: [{ name: "用户" , event: aas, icon: "fa-user" }, { name: "通讯录" , event: function () { }, icon: "fa-address-book" }, { name: "打车平台" , event: function () { }, icon: "fa-bus" }, { name: "文件系统" , event: function () { }, icon: "fa-file" }] }); |
1 2 3 4 5 6 7 8 9 10 | $( "#ccc" ).NZ_Menu({ items: [{ name: "测试" , icon: "fa-vial" }] , showbefore: function () { alert( "打开前!" ); }, showafter: function () { alert( "打开后!" ); }, closed: function () { alert( "关闭了!" ); } }); |
1 2 3 4 5 6 7 8 | { items: [], //选项构成:{icon:"",name:"",classlist:[],event:function() {}} fatype: "fas" , //fontawesome的图标类型fas/far bgcolor: "#fff" , showbefore: null , //菜单创建前事件 showafter: null , //菜单创建后事件 closed: null //关闭事件 }; |