I copied this code from a site (credit included) it enables you to disable right clicking just on photos. I haven't installed it yet, because my problem is, I am not sure exactly where to put it. Can anyone tell me this? (I don't do much coding work on my site.)
I did create a plain old html page and test it, and it works, it lets you right click everywhere but on an image.
Thanks
L
<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, you don't have permission to right-click.";
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[i].onmousedown = right;
document.images[i].onmouseup = right;
}
}
}
// End -->
</SCRIPT>
</HEAD>
<!-- STEP ONE: Copy the event handler into the BODY tag -->
<BODY onLoad="trap()">
<!-- Script Size: 0.81 KB -->