屏蔽网页右鍵(兼容IE6,IE7,IE8,FireFox,谷歌Chrome)

屏蔽网页右鍵(兼容IE6,IE7,IE8,FireFox,谷歌Chrome)

<script type="text/javascript">
function clickIE4(){
if (event.button==2){
return false;
}//end if
}//end func

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;
}//end if
}//end if
}//end func

function OnDeny(){
if(event.ctrlKey || event.keyCode==78 && event.ctrlKey || event.altKey || event.altKey && event.keyCode==115){
return false;
}//end if
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
document.onkeydown=OnDeny();
}else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
document.onkeydown=OnDeny();
}//end if

document.oncontextmenu=new Function("return false");
</script>
分享到:
标签:javascript,右键屏蔽,屏蔽,鼠标右键,
^_^ 亲爱的客官,如果您觉得本文对您有好处,请移动你的鼠标点点下面的广告或上面的或右上角的,非常感谢~ ^_^

报歉!评论已关闭.