How disable right click on blogger images only?

My previous post on how to disable to right click on blogger. This post explains how to disable right click only on images. It is also important to disable the right click on images in which your blog image may be copied with your permission. And this message is useful to protect some copyrighted images but some loyal user may be disappointed as right click option has been disabled. And after all it just to protect your content from being copied.

And it is very difficult to keep people from copying our content like texts,images and others. But we can minimize it by disabling some functions.

How to add this script to blogger

Step 1: Go to Blogger Dashboard -->Select Layout-->Add Gadget-->HTML / JavaScript

Step 2: Copy the code given below.

Step 3: Save the HTML/ JavaScript and finally view your blog.

<script language="JavaScript1.2">

<!--

//Disable right mouse click Script

//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive

//For full source code, visit http://www.dynamicdrive.com


var clickmessage="Function disabled on images!"

///////////////////////////////////

function disableclick(e) {

if (document.all) {

if (event.button==2||event.button==3) {

if (event.srcElement.tagName=="IMG"){

alert(clickmessage);

return false;

}

}

}

else if (document.layers) {

if (e.which == 3) {

alert(clickmessage);

return false;

}

}

else if (document.getElementById){

if (e.which==3&&e.target.tagName=="IMG"){

alert(clickmessage)

return false

}

}

}


function associateimages(){

for(i=0;i<document.images.length;i++)

document.images[i].onmousedown=disableclick;

}


if (document.all)

document.onmousedown=disableclick

else if (document.getElementById)

document.onmouseup=disableclick

else if (document.layers)

associateimages()

// -->

</script>

Note: Replace  Function disabled on images!  with your own message like "No Right Click On Images Allowed Here

Post a Comment

0 Comments