View Full Version : No Highlighting?


Takhisis16
04-10-2003, 05:58 AM
Hi all, I have a question, where do I find the scrip to keep people from highlighting text on my page? I've noticed that it also prevents any right-clicking as well. Thanks :)

epolady
04-10-2003, 06:17 AM
<SCRIPT language="JavaScript1.2">
//Disable select-text script (IE4+, NS6+)- By Andy Scott
//Exclusive permission granted to Dynamic Drive to feature script
//Visit http://www.dynamicdrive.com for this script
function disableselect(e){
return false
}
function reEnable(){
return true
}
//if IE4+
document.onselectstart=new Function ("return false")
//if NS6
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}
</SCRIPT>

doesn't prevent no-right clicking (which doesn't work anyhow)