js禁用右键点击
2016-12-26 Js 1024
很实用的javascript:
function no_right(e){
if(!document.rightClickDisabled){
if(document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown = disableRightClick;
}else{
document.oncontextmenu = disableRightClick;
}
很实用的javascript:
function no_right(e){ if(!document.rightClickDisabled){ if(document.layers){ document.captureEvents(Event.MOUSEDOWN); document.onmousedown = disableRightClick; }else{ document.oncontextmenu = disableRightClick; } return document.rightClickDisabled = true; } if(document.layers || (document.getElementById && !document.all)){ if (e.which==2||e.which==3) return false; }else{ return false; } } no_right();
很赞哦! (0)
相关文章
文章评论
-
-
-
0条评论