I use this. I hope this is the whole thing, if not, you can find it at the
site mentioned. It will only disable right-click on images, not the whole
page. If the user right-clicks on the image, they will get an alert popup.
You can change the message to whatever you want - in the quotes right after
var msg =
Of course, a savvy user can still get to the images, but it might help
somewhat. Put it in the head section of the pages you want it to work on.
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!!
http://javascript.internet.com -->
<!-- Begin
function right(e) {
var msg = "Sorry, this image can not be saved.";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
else return true;
}
function trap()
{
if(document.images)
{
for(i=0;i<document.images.length;i++)
{
document.images
.onmousedown = right;
document.images.onmouseup = right;
}
}
}
// End -->
</SCRIPT>