Khamis, 8 November 2012

Disable highlighting text script blogger

This article it's just about how to disable highlighting script for blogger. Because sometimes blogger doesn't like its article is plagiated. And the advantage of this script, your textarea, input, scroll will not effected. But the disadvantage is just if you have a blog with about coding, maybe the visitor will can't be highlight or copying your code. Ok this is easy....

Tutorial

Just add this code to a widget, or open blogger.com, select blog, click layout tab, add widget text/HTML, paste this code and save.

<script type="text/javascript">

/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//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=disableselect
document.onmouseup=reEnable
}

</script>
Ok just that, you are finish

Tiada ulasan:

Catat Ulasan