(1)屏蔽选中事件
document.onselectstart=function(){return false;}
(2)屏蔽右键菜单
document.οncοntextmenu=function(){return false;}
(3)另一种屏蔽右键菜单 字串4
document.οnmοusedοwn=function(){
if(event.button==2)return false;
}
(4)屏蔽ctrl按键
document.οnkeydοwn=function(){
if(event.ctrlKey)return false;
}
代码:
document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;}
解决页面无法复制js
最新推荐文章于 2024-05-06 19:36:47 发布