|
Answer
by: Kristen Jourdonais, Aplus.Net Knowledge Base Support.
It
is difficult to implement a fool-proof method of keeping your website
visitors from saving and possibly redistributing images on your
website. However, there are certain methods that can prevent most users
from saving your unique or copyrighted images from your web page. The
most popular method includes using JavaScript.
The
script that follows denies a user from using the
“right-click” functionality of their mouse that is
typically used to save an image from a web page. To install the
“No Right-Click” script on your page, paste this
code into the HEAD of your HTML document:
<HEAD>
<SCRIPT
LANGUAGE="JavaScript1.1">
<!--
Begin
function
right(e) {
if
(navigator.appName == 'Netscape' &&
(e.which
== 3 || e.which == 2))
return
false;
else
if (navigator.appName == 'Microsoft Internet Explorer'
&&
(event.button
== 2 || event.button == 3)) {
alert("Sorry,
you do not have permission to right click.");
return
false;
}
return
true;
}
document.onmousedown=right;
document.onmouseup=right;
if
(document.layers) window.captureEvents(Event.MOUSEDOWN);
if
(document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
// End
-->
</script>
</HEAD>
|