网上找了许多,但是好多都不兼容 有的不兼容IE 有的不兼容Firefox
下面代码检测有效
js代码:
document.οncοntextmenu=new Function("event.returnValue=false;");
document.οncοntextmenu=function(e){return false;}
document.onselectstart=new Function("event.returnValue=false;");
css代码:
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;