Disable Right Click, Stop Image Theft
If you're tired of your images showing up on Russian and Chinese web sites or web sites belonging to people/businesses with initials AH, give this a try.
There's lots of ways to disable the mouse Right-Click menu so that visitors to your web site can not "Save Image As . . ." Here's two different options you can easily add to your web pages.
Option 1, Disable Right Click Without Warning Message - this will not alert the viewer to the disable feature.
After the BODY tag on your web page, insert the following code:
<script language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!docum ent.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document. onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontext menu=clickIE;}
document.oncontextmenu=new Function("return false")
</script>
Option 2, Disable Right-Click Feature With Alert Message - an alert message box will pop up to alert the page viewer. You can change the message to say whatever you want by changing the code.
After the BODY tag on your web page, insert the following code:
<script language=JavaScript>
var message="Right Click Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;}}
function clickNS4(e){
if (document.layers||document.getElementById&&!docume nt.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;}
document.oncontextmenu=new Function("alert(message);return false")
</script>
Give this a try. It is by no means foolproof but it will stop a lot of people from taking images. If you find any bugs with the code, let me know. I've added the first code to my site and it works well.
Brad
__________________
Everything that can be invented has been invented - Charles H. Duell, Commissioner, U.S. Patent Office, 1899
Many of life's failures are experienced by people who did not realize how close they were to success when they gave up. - Thomas Edison
To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts. | To view links or images in signatures your post count must be 5 or greater. You currently have 0 posts.
|