Jump to content

Disable Right Click


The Little Guy

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.