Featured

    Featured Posts

  • Relation Between Games and Studies
  • Best Screen Protector for Nintendo Switch Available So Far
  • Gamer Problems: Then vs. Now [Comic]
  • Facebook Messenger May Soon Get Reactions, Dislike Button
  • What Happens When You Stop Smoking?

How To Disable Mouse Selection On Blogger And WordPress

For Protecting you blog from copyright this is the easiest way is to disable mouse selection on your blog, after this no one can copy text and images, we can make it possible by using small JavaScript code which will disable mouse selection on blog.

JavaScript Code For Disabling Mouse Selection

<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false }
function reEnable(){
return true }
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else {
document.onmousedown=disableselect
document.onmouseup=reEnable }
</script>

How to use for Blogger
  • Go to blogger dashboard
  • Click on Template tab.
  • Now Add Gadget >> HTML/JavaScript
  • Paste JavaScript code above.
  • Click on Save button.

How to use for WordPress
  • Go to Wordpress dashboard
  • Now click on Appearance >> Widgets >> Add New Text Widget
  • Paste JavaScript code above.
  • Click on Save button.
This trick is working on all major browser which support JavaScript.

www.CodeNirvana.in

Copyright © New Techie