Posted: Mon Jun 07, 2004 11:30 am How do I disable the right-click function?
Disabling the right-click function on your web page will not prevent others from doing what you are trying to stop them from doing, including copying your HTML and images. There are always easy ways around the disabled right-click, but in case you want it anyway here it is:
Code:
<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximusatnsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Function Disabled!";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum