jquery上下文菜单插件 - 右键单击​​事件类型在哪里? [英] jquery context menu plugin - Where is the right click event type?

查看:56
本文介绍了jquery上下文菜单插件 - 右键单击​​事件类型在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究下面插件的代码,并想知道它何时何地与右键单击事件相关联。它所做的就是

I was studying the code for the plugin below and wondering where and when does it tie the "Right Click" event. All it does is

插件参考链接: http ://www.javascripttoolbox.com/lib/contextmenu/

$(this).bind('contextmenu',function (e){cmenu.show(this,e); return false;});

和contextmenu是一个自定义的jquery事件类型。

and "contextmenu" is a custom jquery event type.

有人可以解释这一切是如何运作的吗

Can someone please explain how all this works

我确实检查过点击事件但是那些是绑定到菜单项而不是与菜单相关的元素。

I did check there are click events but those are tied to the menu items and not the element to which the menu is tied.

谢谢

答案: contextmenu不是自定义事件类型。它实际上是'右键单击'的另一个名称(映射等)

Answer: "contextmenu" is not a custom event type. It is actually another name (mapping etc) for 'right click'

推荐答案

contextmenu 自定义jQuery事件(查看其上的MDC文章这里)。所有插件正在做的是将事件处理程序绑定到此事件并显示/隐藏菜单。

contextmenu is not a custom jQuery event (check out the MDC article on it here). All the plugin is doing is binding an event handler to this event and showing/hiding a menu.

这篇关于jquery上下文菜单插件 - 右键单击​​事件类型在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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