您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

禁止IE用右键的JS代码_javascript技巧

2024/11/30 14:13:50发布14次查看
复制代码 代码如下:
document.body.oncontextmenu=function rightclick(){ window.event.returnvalue= false;}
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
}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product