BWRS SEARCH

advertisement

How To Stop Right Clicks

One of the problems with any good site is people are going to pinch your images etc.Given the fact you just need to right click over any image this is very easy. There is no easy way to stop this but with a little bit of JavaScript you can make things a little harder for internetexplorer users by locking out right clicking (Although users of v4.x or earlier Netscape will be unaffectred and there are still tons of ways to get round this for IE users)

The code works by defining the function press to trigger an alert box if the right mouse button (button==2) is pressed. It needs the document statement to trigger it when the mouse buttons are pressed (onmousedown)

You can change the alert box message (just avoid using' or "). You can also (if you're truely insane) disable the left button instead by changing button==2 to to button==1)

Remember this is only a minor measure that only works on some browsers and, even with them, it can be easily overcome