禁止鼠标各种操作的代码
来源:互联网 发布:网络语言的特点 编辑:程序博客网 时间:2024/05/20 18:52
document.onselectstart =function() {return false;} // 防选择
document.oncopy =function() {return false;} // 防复制
document.oncut =function() {return false;} // 防剪贴
document.onbeforecopy =function() {return false;}
document.ondragstart =function() {return false;} //防拖动
document.oncontextmenu =function() {return false;} //防右键
document.onmouseup =function() {document.selection.empty();}
document.onselect =function() {document.selection.empty();}
document.oncopy =function() {document.selection.empty();}
document.onmousedown =function() {if (event.button!==1){alert('禁止操作');}}
document.onkeydown =function() {alert("禁止操作");event.keyCode=0;event.returnValue=false;}
// 屏蔽PrintScreen
function testclip(){
try {
if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL")) //检测系统内存
{
null; //不为图像则保留内存
}
}
catch(e){
clipboardData.setData("Text","")//清空内存
}
setTimeout("testclip()",500)
}
testclip();//不停清空剪贴板
// 禁止打印
@media print{
body{display:none}
}
// 禁止保存
<noscript>
<iframe src="*.htm"></iframe>
</noscript>
// 禁用右键
function nocontextmenu(){
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e){
if (window.Event){
if (e.which == 2 || e.which == 3)
return false;
}else if (event.button == 2 || event.button == 3){
event.cancelBubble = true;
event.returnValue = false;
return false;
}
}
//禁止右键
document.oncontextmenu=nocontextmenu; // for IE5+
document.onmousedown=norightclick; // for all others
禁用
window.ClearEvent=function(){event.cancelBubble=false;
var sSrcTagName=event.srcElement.tagName.toLowerCase();
return (sSrcTagName=="textarea" || sSrcTagName=="input" || sSrcTagName=="select");}
window.ClearKey=function(){event.cancelBubble=false;var iKeyCode=event.keyCode;return !(iKeyCode==78 && event.ctrlKey);}
with (window.document){oncontextmenu=onselectstart=ondragstart=window.ClearEvent;onkeydown=window.ClearKey;}
- 禁止鼠标各种操作的代码
- 禁止鼠标右键的代码(转)
- 禁止鼠标右键保存图片、禁止拖动图片的代码
- html禁止鼠标操作
- 禁止鼠标选中,禁用鼠标右键的代码
- DELPHI中鼠标的各种操作
- DELPHI中鼠标的各种操作
- 全面禁止页面鼠标操作
- 用javascript禁止操作的代码
- 网页禁止鼠标功能代码之禁止鼠标选中
- MFC禁止窗口最大化按钮和禁止鼠标改变窗口大小的操作
- 禁止ctrl+n和 禁止ctrl+r和 禁止shift+f10 禁止鼠标右键or左右键 和禁止f5 的JS代码
- 禁止ctrl+n和 禁止ctrl+r和 禁止shift+f10 禁止鼠标右键or左右键 和禁止f5 的JS代码
- 禁止ctrl+n和 禁止ctrl+r和 禁止shift+f10 禁止鼠标右键or左右键 和禁止f5 的JS代码
- HTML网页禁止鼠标操作脚本
- 博客技巧----各种漂亮的鼠标URL代码
- 模仿鼠标操作代码
- js网页禁止复制-禁止另存为-禁止选择-禁止鼠标右键代码
- java的System.getProperty()方法详解
- AVL树及其实现
- 想念那一池莲花
- A表上百万数据,B库百条数据,查询有B条件的所有A的数据
- 划分问题
- 禁止鼠标各种操作的代码
- JDK泛型中的问号(?)的用途 (泛型集合类的作为参数的时候的继承问题)
- 最大子段和——分治与动态规划
- 网路字节顺序和主机字节顺序
- 比较Perl、PHP、Python、Java和Ruby 【转载】
- 新手如何看k线(图) .
- textarea去掉右侧滚动条,去掉右下角拖拽【鸡蛋】
- java.lang.OutOfMemoryError:PermGen space 或者Java heap space的产生原因以及解决办法
- 怎么更改ofbiz的端口