The Little Guy Posted August 10, 2012 Share Posted August 10, 2012 On my site, I want to disable the default context menu if you right click on certain div's, for the following reasons: 1. One of the overflow div's will have a feature that uses the right click to scroll left/right 2. Some options will have a custom context menu. I cant find a script on Google that does this. Any suggestions? Quote Link to comment Share on other sites More sharing options...
Psycho Posted August 10, 2012 Share Posted August 10, 2012 On my site, I want to disable the default context menu if you right click on certain div's, for the following reasons: 1. One of the overflow div's will have a feature that uses the right click to scroll left/right 2. Some options will have a custom context menu. I cant find a script on Google that does this. Any suggestions? Yes, try another approach. Disabling the right-click within a web page is something that was routinely used in the 90's to try and "secure" the page from those wanting to see the code, copy images, etc. It is easily circumvented and only frustrated users that used the context menu (e.g. for printing, saving a bookmark, etc.). The context menu is a built in feature of the Operating System/Application. By disabling a feature that people expect, and possibly rely on, for the ability to scroll in a DIV will not be seen as an enhancement. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 11, 2012 Author Share Posted August 11, 2012 I am not building this for users, I am building it for me, and Google does it and I have heard no one complain about it. and do you like using the scroll bars when scrolling up/down/left/right? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted August 11, 2012 Author Share Posted August 11, 2012 document.oncontextmenu = function() {return false;}; Quote Link to comment Share on other sites More sharing options...
Psycho Posted August 11, 2012 Share Posted August 11, 2012 I am not building this for users, I am building it for me, and Google does it and I have heard no one complain about it. and do you like using the scroll bars when scrolling up/down/left/right? Um, the mouse-wheel works just fine for me as an intuitive, simple solution when needing to scroll up and down. As for side-to-side, the vast majority of sites build their pages in such a manner that the content will expand/collapse to fit the available width. Ones that don't are not very good at what they do. But, if you really want to do that go right ahead. I have no idea where Google employs such a feature. But, if they do, perhaps you should spend more time using the primary feature of Google (searching) instead of looking for flashy features that provide no real value. because, I find it impossible to believe that you even did a cursory search for this feature on Google. My first search brought up tons of examples, code examples, etc., etc. Quote Link to comment Share on other sites More sharing options...
gizmola Posted August 11, 2012 Share Posted August 11, 2012 I am not building this for users, I am building it for me, and Google does it and I have heard no one complain about it. Where exactly does Google stop you from right clicking? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.