Assalamualaikum and Welcome to my blog, online .May you be showered by Allah's blessings! :D | Follow or Dashboard

Saturday, 7 January 2012

Tutorial Disable Highlight

Greeting Text
Assalamualaikum dan Bismillahirahmanirahim~ haha, macam biasa saya nk buat tuto disable highlight. Ape tu? Kiranya cursor awak tu takboleh highlight :) Harap faham sebab saya tkthu nak jelaskan cmne. Hihi, nak try tak? code dia takpayah ganggu edit html punya. Cuma add a gadget je :) As easy as ABC. Chewaah! :D
Design > Add a Gadget >Html/Jacascript 
Copy code bawah ni dan paste jelah :)


<script type="text/javascript">function disableSelection(target){if (typeof target.onselectstart!="undefined") //IE routetarget.onselectstart=function(){return false}else if (typeof target.style.MozUserSelect!="undefined") //Firefox routetarget.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> 

Jadi tak? sesetengah jadi, sesetengah tak. Tapi, kalau tak jadi cuba yang ni lak :)
DASHBOARD > DESIGN > EDIT HTML> TICK EXPAND WIDGET TEMPLATES

search code ni >
</body>

dh jumpa? copy code bawah ni dan paste kat atas  </body>

<em><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=disableselectdocument.onmouseup=reEnable}</script></em>

amacam? Jadi tak? Try ya, harap jadi. Okey, Waalaikummussalam :D

0 comment:

Post a Comment

Assalamualaikum.
Do comment ya. InsyaAllah I will reply :)