How to disable right click on Blogger image using widget

Guys,Today i share how to disable right click on Blogger blog image. To know How to redirect your Blog site to other site click the link.

Instructions

  • Log in to blogger  Account
  • Then Go to Design and select Page Element
  • Click  'Add a Gadget' and select 'HTML/Javascript'
  • Paste below code.
<script language="JavaScript1.2">

var clickmessage="Right click 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>
4. Now click save option. you are done. 
Enjoy !!

0 comments:

Post a Comment

Feature Article

Popular Posts

Recommended Article

Loading...

Live cricket