So for several reasons ranging from what i referred to above, to protection of images or that of source code and many other reasons, a blogger may decide to disable ability of site visitors to right-click on their blog.
To disable the ability for your readers to right-click on your blog, you will have to paste a few lines of JavaScript into your blog. Do also note that aside disabling right-clicking across your blog, you may also want to set disability to right-click on particular pages.
How To Disable Right-Click on Your Blog or On A Particular Page
METHOD 1: Inserting via the Blog Template
- Log into your Blogger dashboard. From here, select and click Template > Edit HTML > Proceed
- Search for this code in the template:
</head>
- Paste the code below just before the </head> in your template:
<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
METHOD 2: Inserting via the 'HTML/Javascript' Gadget
I also accidentally discovered this method of implementing the code. Although I blog using the Blogger.com platform, I believe this will also work for any other blogging platform. This method is especially better for bloggers who are not so techie:- Login into your Blogger dashboard, and click on 'Layout'
- In Layout, click on the 'Add a Gadget' link. When it comes up, scroll down and select /click on 'HTML/Javascript'. When this opens up, copy the code above and apply onto the blank interface.
- Click 'Save', and position it wherever you want (i positioned mine below Blog Posts). And you are done!
Congrats! No-one would right-click on your blog from now henceforth.
NOTE: Both the first and the second methods will work. I believe this code will also work in a non-blogger template. I really hope it does on other platforms. On Blogger, it does work!
No comments:
Post a Comment