Knowledgebase: Tips & Tricks
How can I protect the images on my website?
Posted by Support on 20 December 2007 04:55 AM
There is no fool-proof method for image protection. But a simple way is with the 'no right clicks' script. You can stop right clicks with a script (copy and paste it from this page if you want to) in the HEAD section of your page.

<script type="text/javascript">
var msg="mouse right click disabled.nn(or any message you want)";

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(msg);
return false;
}
}

if (document.layers) {
if (e.which == 3) {
alert(msg);
return false;
}
}
}

if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;

</script>
(588 vote(s))
Helpful
Not helpful

Comments (0)