admin管理员组文章数量:1391977
I've been tasked with a requirement to override the browser's right-click functionality and add client specific options to the context menu, as well as the options that are already there. Is this possible? If so, what kind of work is involved?
I noticed that on Google Docs, they have replaced the context menu with their own implementation of a context menu with their own options. How much work is involved with implementing something like this?
I've been tasked with a requirement to override the browser's right-click functionality and add client specific options to the context menu, as well as the options that are already there. Is this possible? If so, what kind of work is involved?
I noticed that on Google Docs, they have replaced the context menu with their own implementation of a context menu with their own options. How much work is involved with implementing something like this?
Share Improve this question asked Feb 2, 2011 at 15:09 DaveDevDaveDev 42.3k73 gold badges232 silver badges395 bronze badges 6- 1 You can make your own, but the browser has settings to not allow you to hide it. So if the user has that set, there is nothing you can do. – epascarello Commented Feb 2, 2011 at 15:14
- I think it's usually a bad idea to have custom context menus on web sites just because it is unexpected and not what people are used to on the web. Also, as epascarello says, some users have their browsers set to not allow this. – tster Commented Feb 2, 2011 at 15:15
- @tst true in general but it can be good idea to have such menu over certain elements, not over the global document. – user447356 Commented Feb 2, 2011 at 15:24
- @Shadow Wizard, so long as there is another way to do everything that the context menu gives you. The problem is that many users (including me) never right click on web pages because I always assume it will bring up the browser context menu. – tster Commented Feb 2, 2011 at 15:28
- @tst yup but suppose the web page show list of files that looks like Windows Explorer - then I would expect to have similar context menu as well. :) – user447356 Commented Feb 2, 2011 at 15:48
2 Answers
Reset to default 10You can't "inherit" the browser context menu. The only way is having your own custom menu.
Quick Googling brings up this plugin for example, which looks pretty neat:
You can also try YUI Menu. In my experience YUI is more browser patible and extremely well documented. Here's a context menu example
本文标签: javascriptIs it possible to override the contextmenu in a browserStack Overflow
版权声明:本文标题:javascript - Is it possible to override the context-menu in a browser? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744756842a2623513.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论