jQuery网页右键菜单

所属分类:其他-独立的部件,杂项

 30327  391  查看评论 (3)
分享到微信朋友圈
X
jQuery网页右键菜单 ie兼容11

使用方法

引用jQuery库和插件以及样式文件

<link rel="stylesheet" href="assets/style.css">
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="assets/script.js"></script>

调用插件

$(document).ready(function() {
    var rcm = window.RMenu;
    rcm.init({
        area: 'body',
        items: {
            "edit": {
                name: "编辑",
                icon: 'edit'
            },
            "del": {
                name: "删除",
                icon: 'trash-o'
            },
            "add": {
                name: "添加",
                icon: 'plus',
                items: {
                    "new-text": {
                        name: "添加文件",
                        icon: 'file-text'
                    },
                    "new-zip": {
                        name: "添加ZIP",
                        icon: 'file-zip-o'
                    }
                }
            },
            "refresh": {
                name: "刷新",
                icon: 'refresh'
            },
            "down": {
                name: "下载按钮",
                icon: 'cloud-download'
            },
            "new": {
                name: "新建",
                icon: 'file',
                items: {
                    "new-text": {
                        name: "新建文件",
                        icon: 'file-text'
                    },
                    "new-zip": {
                        name: "新建ZIP",
                        icon: 'file-zip-o'
                    }
                }
            }
        },
        callback: function(res) {
            if (res.data == 'edit') {
                console.log('点击了edit');
            } else if (res.data == 'del') {
                console.log('点击了del');
            } else if (res.data == 'add') {
                console.log('点击了add');
            } else if (res.data == 'refresh') {
                window.location.reload();
            } else if (res.data == 'down') {
                console.log('点击了download');
            }
        }
    })
});
相关插件-独立的部件,杂项

jQuery网站引导插件joyride

jQuery网站引导插件joyride
  独立的部件
 32804  325

jquer网页打印插件PrintArea.js

jquery实现页面打印可局部打印
  独立的部件
 70073  405

jQuery分享插件jquery.share.js

jQuery分享插件jquery.share.js享到QQ、微信、微博、google、in、tweeter等
  独立的部件
 113941  638

jQuery自动定位当地天气预报

jQuery调用新浪天气,显示城市天气气温风向风级图标白天夜间
  独立的部件
 61905  437

讨论这个项目(3)回答他人问题或分享插件使用方法奖励jQ币 评论用户自律公约

    曹懦懦?? 0
    2022/1/1 22:27:05
    当有二级菜单时,其父级菜单点击不应有点击事件~~~ 回复
    wangd0128 0
    2020/10/22 10:42:38
    Monkeyhehang 0
    2018/7/25 15:09:30
    只能window调用吗 回复
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
😃
  • 😀
  • 😉
  • 😥
  • 😵
  • 😫
  • 😘
  • 😡
  • 👍
  • 🌹
  • 👏
  • 🍺
  • 🍉
  • 🌙
  • 💖
  • 💔
取消回复