Blogger Tricks : Disable right click on blog

0 comments
Save to del.icio.us 0 hits!

Today, I am posting a MUST HAVE trick to our blogger fans.

Right click on any Internet Browser is a very important element & we must use it when it comes to copy or editing texts.

BUT some people misuse it by copying our work.

To make Right Click disabled on your blog, to protect your text, images links and etc….you just have to follow few simple steps.



+/- Steps to follow


You’ll need to add new Html/Javascript element to your layout.


  • Navigate to Layout >> Add a Gadget >> and Select Html/Javascript
  • Paste the code given below.



script language="JavaScript">
<!--

//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) 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>


  • Save the Html/Javascript & view you blog.

NOTE : When you try to do right click on blog, a message will display as “Function disabled”
You can change this message too.


To change the message :


  • Find the next line in the code

var message="Function Disabled!";


  • Change Function Disabled! to what ever message you want to display.

Still have any problem ? Post it in the comment box and i shall be hopefully quick to reply.


(If you really liked my posts, please "SUBSCRIBE" so that you will never miss a single post)

Related Posts :



Comments
0 comments
Do you have any suggestions? Add your comment. Please don't spam!
Subscribe to my feed

Post a Comment

About Me

Latest posts

Blogger Zone