如何阻止文本選擇不輸入文本區域和選擇項目 實際上我在IE工作,但不是在其他瀏覽器,這是腳本:如何阻止文本選擇不輸入文本區域和選擇項目
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
}
document.onmousedown=click;
function click()
{
if ((event.button==2) || (event.button==3)) { alert("Yazı Kopyalayamazsınız!");}
}
我需要以相同的方式工作,它在其他瀏覽器,必須有一個現成的劇本,只是無法找到淨..
那麼你的意思是你的問題 – tekknolagi 2011-01-11 08:25:06
我需要阻止在其他瀏覽器上的相同方式不是很明顯嗎? – 2011-01-11 08:26:15