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
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744756842a4591932.html
评论列表(0条)