- function key(){
- if(event.shiftKey){
- window.close();}
- //禁止Shift
- if(event.altKey){
- window.close();}
- //禁止Alt
- if(event.ctrlKey){
- window.close();}
- //禁止Ctrl
- return false;}
- document.οnkeydοwn=key;
- function nocontextmenu(){
- //alert("a");
- try{
- event.cancelBubble = true
- event.returnValue = false;
- }catch(e){
- }
- return false;
- }
- function norightclick(){
- if (event.button == 2 || event.button == 3){
- //alert("a");
- try{
- event.cancelBubble = true
- event.returnValue = false;
- }catch(e){
- }
- return false;
- }
- }
- document.oncontextmenu = nocontextmenu; // for IE5+
- document.onmousedown = norightclick; // for all others
- document.onselectstart = function(){
- return false;
- }
- document.ondragstart = function(){
- return false;
- }
JS禁止右击菜单、复制、选择
最新推荐文章于 2023-03-01 09:40:45 发布