左键单击 wdContextMenu

发布于 2024-10-08 21:49:42 字数 235 浏览 0 评论 0原文

web-delicious 有一个很好的分层上下文菜单 jQuery 插件: wdContextMenu。我也想在左键单击上使用它,但我不知道如何执行此操作(没有按钮或代码中的所有绑定、单击和输出方法似乎都可以执行其他操作)。 也许以前有人这样做过。

There is a nice hierarchical jQuery PlugIn for context-menus from web-delicious: wdContextMenu. I want to use it on left clicks too, but I can't figure out how to do this (no button or which in the code, all bind-, click- and out-methods seem to do sth else).
Perhaps someone has done this before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

意中人 2024-10-15 21:49:42

您需要将行更改

return $(this).bind('contextmenu', function(e) {

为:

return $(this).bind('click', function(e) {

You need to change the line:

return $(this).bind('contextmenu', function(e) {

to

return $(this).bind('click', function(e) {
遮了一弯 2024-10-15 21:49:42

经过快速演练后,我认为这是不可能实现的,因为
该插件使用 oncontextmenu 事件,在构建菜单组件的过程中,单击事件(用于左键单击)被覆盖,以使元素始终返回 false。

After a quick walkthrough I don't think this is achievable because
this plugin uses oncontextmenu event and in the process of building up the menu component the click event(which is for the left click) is overridden for the elements to return false always.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文