Home arrow Blogger Tips arrow No Right Click Script
No Right Click Script PDF Print E-mail
 
Written by Administrator, on 21-02-2008 19:45
Editor's rating
Average user rating    (1 vote)
Views 3182    

This is a cross browser DHTML script that will prevent the default right menu from popping up when the right mouse is clicked on the web page. Use it to stop surfers from easily saving your web page, viewing its source, or lifting images off your site when using either IE 4+ or NS 4+. Thank you to DynamicDrive.com . I have tested this script and it is working in Blogspot.com. You can copy the script below and paste into your HTML/Javascript Elements in Blogspot.com.

This script will not allow people to right click on the image. This will prevent people from easyly copying images from your blog.

What will happen with this script? When people right click on the image, the pop-up window will appear with a messege. You can modify the messege as you like.

This script is only like alert messege. People can still copy the image using other ways.

If you really do not want people to copy. You should do 2 steps below:

1. Upload the image in Picasa Web Gallery in a private album.
2. You need to add the "Disable Text Selection Script" . By doing this step, other people can not even copy texts.

 No Right Click Script
(copy the script below and add it  to the HTML/Javascript Page Element in your Blogspot.)

<script language=JavaScript>
<!--

//Disable right mouse click Script
//By Maximus ( This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.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>

 

Last update: 13-04-2008 22:07

Quote this article in website Favoured Print Send to friend Related articles Save this to del.icio.us

Users' Comments (1) RSS feed comment
Posted by sitiazma, on 26-02-2008 15:20,
1. Useful Script
For blogspot blogger, combine this script and use the url link to the image from Picasa.
 
» Report this comment to administrator
» Reply to this comment...

Add your comment



mXcomment 1.0.6 © 2007-2008 - visualclinic.fr
License Creative Commons - Some rights reserved
< Prev

Login Form






Lost Password?
No account yet? Register

Who's Online

Statistics

Visitors: 102660

[+]
  • Narrow screen resolution
  • Wide screen resolution