December 10th, 1999, 01:34 PM
I was once on a page were everytime you used right-click an aler message came and I couldn't use any teh mouse button. (Pretty effectively stopping me from using any of the options that are in the dropdown menu normally displayed)
Sadly I can't find the page any longer, so, anybody here has any idea???
SORRY!!! I just found out that this has been discussed already!!! SORRY!!! In case anybody wants the code anyway:
/*Disable right mouse click Script© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and
*/ if (document.all) document.body.onmousedown=new Function("if (event.button==2|
|event.button==3)alert('The right mouse button has been disabled')")
[This message has been edited by Chriss (edited 12-10-99).]
December 10th, 1999, 05:04 PM
using no right click on a site is useless.
anyone with half a brain can view your source. all it really does is stop the novice from viewing your source or grabbing your images.
December 11th, 1999, 06:28 AM
Unfortunately the code I found doesn't quite work, so if anybody could help me with that I'd highly appreciate it! If I simply copy&paste it I get an error message in both NE4.7 and IE5, if I remove the "body" in the fist line it works only in IE5 and not in NE, anybody knows why???
December 14th, 1999, 01:41 PM
you are checking if (document.all). That implies IE. If you want to make this work for NS, you need to check for (document.layers). You also need to use captureEvents() and then assign a function to event.CLICK.
I know this is a little cryptic, but with a little more digging, you can find sample code all over the place for this.