Search this site!

Return to the CSB Support home page
Disable Right Click
Description:
This version supports all versions of Internet Explorer and Netscape!  A special thanks to Mike McGrath who supplied this code!
How to use:
Simply cut and paste the code provided onto your web page via Insert HTML Code/BYOWG.  You may wish to change the color used when rolling over your links.
Example:
  Try right clicking on this image ->

Download the code
right click on link, then click on 'Save target (or frame) as'
Other information:
The Javascript must be inserted on every page you wish to disable the right click button.  An easy way to do this with CuteSITE Builder 4.0 is to insert the code while editing the Page Layout.  This will automatically add it to every existing page based on that template!

Source code:

<script language=JavaScript>
<!--

/*
Disable right mouse click Script (By Crash @ http://walk.to/crash)
Submitted to and permission granted to Dynamicdrive.com to feature script in it's archive
For full source code to this script and 100's more, visit
http://dynamicdrive.com
*/

var message="Right mouse click disabled for this page";
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</script>