Follow us on Facebook

How to Disable Right Click in Your Blog or in a Webpage ?


Some times it become important to disable right click for many reasons such as protecting images or source code of any page. Luckily, JavaScript is here to help you out. You can disable right click by pasting few lines of JavaScript in your blog. This will disable right click on all your blog pages however you can also set it to disable right click on a certain page. This script is also widely used to protect images to be saved by blog readers. Follow this simple tip to do this;

How to Disable Right Click in Your Blog or in a Webpage ?

  • First you can check DEMO of this script. Open Demo page and try right click.
  • If you are using Blogger, Go do Design > Edit HTML (else, move to next step)
  • Search this code in the template
</head>
  • Paste this code just Before the searched line.
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});
//]]>
</script>
  • Save Your template and you're done!

No comments:

Post a Comment

About

Followers

Like Us

Labels

Donate us For Furture