How To Disable Text selection in Blogger
Here we have come with two different methods of disabling text selection in blogger.
You May Searching For:
First MethodYou May Searching For:
- How To Disable Mouse Right Click,Text Selection and Copying Text
- Disable Text Selection In Few Part Of HTML Page
To disable Text selection in blogger,simply follow the below given steps:
- .Log into your blogger Account .
- Click on “Layout” option.
- After that click on “Add a Gadget” option.
- Select HTML/JavaScript option.
- Now enter the following code in the body part.
<script type="text/javascript">//form tags to omit in NS6+: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=disableselectdocument.onmouseup=reEnable}</script>
Second Method
This tutorial is useful for those of you who want to protect your blog article from copy and paste.- Open your template
- Find </head> tag and put this code above it :
< script type = 'text/javascript' >
function disableSelection(target){
if (typeof target.onselectstart!="undefined") //IE route target onselectstart=function(){return false}
else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
target.style.MozUserSelect="none"
else //All other route (ie: Opera)
target.onmousedown=function(){return false}
target.style.cursor = "default"}
< / script>
- Now Find <body> tag and replace <body> with this code :
< body oncontextmenu= 'return false;' >
< script type = 'text/javascript' >
disableSelection(document.body);
< / script>
I have used first method and it is ewxcellent....Nice Disable Text selection article..
ReplyDelete