左键单击jQUery上下文菜单 [英] jQUery context menu on left click

查看:99
本文介绍了左键单击jQUery上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Chris Domigan的 jQuery上下文菜单插件来应用上下文菜单.它是这样工作的:

I am using jQuery context menu plugin by Chris Domigan to appy a context menu. This is how it works:

$('#contacts tbody tr').contextMenu('myMenu1', {
    bindings: {
        'copy': function(t) {
             alert('Trigger was '+t.id+'\nAction was Copy');
         },

        'delete': function(t) {
             alert('Trigger was '+t.id+'\nAction was Delete');
        }
    },             
});

现在,我希望此上下文菜单在单击时出现,而不是单击右键.我在文档中找不到选项.任何想法如何做到这一点?我需要修改源代码吗?

Now I want this context menu to appear on left click instead of right click. I can not find an option in the doc. Any ideas how to do that? Do I have to modify the source?

推荐答案

作为源标题

ContextMenu-用于右键单击上下文菜单

文档中也没有有关如何更改点击类型的信息.我认为您唯一可以做的就是扩展该代码,使其也可以与基本的"click()"一起使用;)

Also in the doc there's no info about how to change the kind of click. I think the only thing you could do is to extend that code to work with the basic "click()" too ;)

这篇关于左键单击jQUery上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆