简单html网页禁止鼠标右键源码

1.禁止鼠标左右键代码/禁止网页选中/禁止另存为/防复制代码

<body oncontextmenu="return false" onselectstart="return false">
<noscript><iframe src="/*.html>" rel="nofollow" ;</iframe></noscript>
<script>
function stop(){
return false;
}
document.oncontextmenu=stop;
</script>

2.禁止鼠标左右键

<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>

3.禁止选中代码

<SCRIPT language=JavaScript>
document.oncontextmenu=new Function("event.returnValue=false;");
document.onselectstart=new Function("event.returnValue=false;");
</SCRIPT>

4.禁止另存为

<noscript>
<iframe src="/*.htm" rel="nofollow" ></iframe>
</noscript>

5.防拷贝/复制代码

<body leftmargin=0 topmargin=0 >

6.真正的鼠标右键屏蔽

<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>

本博客所有文章归地球者:ALIN迷茫复制或转载请以超链接形式注明转自 北纳星_52bnx.cn
原文地址《简单html网页禁止鼠标右键源码

相关推荐

发表评论

路人甲

网友评论(0)