|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: <script language="JavaScript1.2"> /*Disable right mouse click Scriptİ Dynamic Drive (www.dynamicdrive.com) For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use, visit dynamicdrive.com This script last updated:99/04/05 */ if (document.all) document.body.onmousedown=new Function("if (event.button==2| |event.button==3)alert('The right mouse button has been disabled')") </script> ------------------ [This message has been edited by Chriss (edited 12-10-99).] |
|
#2
|
|||
|
|||
|
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. sawz.com yankeebarnraising.org majiklmoon.com |
|
#3
|
|||
|
|||
|
I am quite aware of that, but if it's just the novices it's at least a start, isn't it? Plus, if you place the code right, use some frames and additional JavaScripting it can be real useful...
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??? ------------------ |
|
#4
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Forbid Right Click on html-document... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|