|
JavaScripts :: Miscellaneous :: No Right Click
Functions in NN 4 and 6, IE 4+ and AOL 5+. This small javascript disables the user's right mouse button. Helps prevent copyright violation. It also defeats a method many users have caught on to which is to hold down the left button and / or scroller, then press the right button. Simply copy and paste the code to the top of your document between the <head> and </head> tags.
The Script
<script>
<!--
/* Copyright http://www.perlscriptsjavascripts.com
Free and commercial Perl and JavaScripts */
isNN = document.layers ? 1 : 0;
function noContext(){return false;}
function noClick(e){
if(isNN){
if(e.which > 1) {return false;}
} else {
if(event.button > 1){return false;}
}
}
if(isNN){
document.captureEvents(Event.MOUSEDOWN);
}
document.oncontextmenu = noContext;
document.onmousedown = noClick;
document.onmouseup = noClick;
// -->
</script>
|
|
|