禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
2010-07-19 16:26
411 查看
禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
1、禁止鼠标左右键
程序代码
<script language=javascript>
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
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
//-->
</script>
2、禁止选中代码
程序代码
<SCRIPT language=JavaScript>
document.oncontextmenu=new Function("event.returnValue=false;");
document.onselectstart=new Function("event.returnValue=false;");
</SCRIPT>
3、禁止另存为
程序代码
<noscript>u ]r=R
<iframe src="*.htm"></iframe>
</noscript>
4、防拷贝/复制代码
程序代码
<body leftmargin=0 topmargin=0>
5、禁止选择文本
程序代码
<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
6.点击右键弹出提示窗口
程序代码
<script>
function stop(){
alert('不允许任何人偷走我的快乐和忧伤~~')//把这里换成你想要看到的话。。
return false;
}
document.oncontextmenu=stop;
</script>
7.真正禁止鼠标左右键代码:
<body bgColor="#FFFFFF" onContextMenu="return false" onSelectStart="return false">
1、禁止鼠标左右键
程序代码
<script language=javascript>
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
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
//-->
</script>
2、禁止选中代码
程序代码
<SCRIPT language=JavaScript>
document.oncontextmenu=new Function("event.returnValue=false;");
document.onselectstart=new Function("event.returnValue=false;");
</SCRIPT>
3、禁止另存为
程序代码
<noscript>u ]r=R
<iframe src="*.htm"></iframe>
</noscript>
4、防拷贝/复制代码
程序代码
<body leftmargin=0 topmargin=0>
5、禁止选择文本
程序代码
<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
omitformtags=omitformtags.join("|")
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
function reEnable(){
return true
}
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
</script>
6.点击右键弹出提示窗口
程序代码
<script>
function stop(){
alert('不允许任何人偷走我的快乐和忧伤~~')//把这里换成你想要看到的话。。
return false;
}
document.oncontextmenu=stop;
</script>
7.真正禁止鼠标左右键代码:
<body bgColor="#FFFFFF" onContextMenu="return false" onSelectStart="return false">
相关文章推荐
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- 禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码
- js网页禁止复制-禁止另存为-禁止选择-禁止鼠标右键代码
- js网页禁止复制-禁止另存为-禁止选择-禁止鼠标右键代码
- 网页防复制,禁止文字选中,禁止右键菜单js代码,兼容大部分浏览器方法
- 禁止右键,禁止选中,禁止网页复制的Js代码
- 网页中“禁止鼠标右键”、“禁止选中”、“禁止拖拽”、“禁止复制(Ctrl+C)”
- 最简单的代码实现禁止鼠标右键及选中网页中的文字,支持Firefox,亲测可用
- 网页禁止鼠标左右键功能的简单代码
- 网页禁止鼠标左右键功能的简单代码
- 禁止另存网页、屏蔽选中、粘贴、复制、剪切、右键菜单程序代码
- 网页禁止鼠标功能代码之禁止鼠标选中
- 网页禁止右键、禁止查看源代码、禁止复制和另存为的代码
- 网页禁止右键、禁止查看源代码、禁止复制和另存为的代码
- JS禁止网页被复制以及禁止鼠标右击代码
- 『小知识』网页中禁止复制的代码
- 网页源代码保护(禁止右键、复制、另存为、查看源文件)
- javascript禁止访客复制网页内容的实现代码
- 禁止页面内选中、复制、鼠标右键的脚本