Tutorial Disable Highlight Text

wah~ hari nie baru mula nak buat tuto.. 
dan nie suma hana buat kerana budak comel bernama 
cik nisya nie~ 



dia suruh hana ajarkan dia supaya tiada orang boley copy paste dia punya entry.. 
tu bisa sahaja .. 
kalo korang buat yg disable right click tu COPYCAT masih lagi boleh copy
dengan tekan shaja ctrl+ c. siap! senang je
tapi kalo korang buat disable hightlight, konpem2 je dia x ley nk copy.. sekarang ikut ye. 

1- masuk bahagian DESIGN> ADD GADGET> HTML CODE.

2- copy code nie yer ;) 

<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"
}
//Sample usages
//disableSelection(document.body) //Disable text selection on entire body
//disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv"
</script>
<script type="text/javascript">
disableSelection(document.body) //disable text selection on entire body of page
</script>
 
3-  paste kan dalam html tadi~ 

SIAP~ 


p/s: sekarang orang lain just can see je la ;) selamat mencuba.. kalo ada pape masalah, comment aja ;) 


4 comments:

hello bloggers!
hope you are enjoying visit my blog
you can ask anything to me~
^_^ hanna ^_^