在图片上禁止右键:
<body ONLOAD="wiper()">
<SCRIPT LANGUAGE=javascript>
<!--
function makeArray(n)
{
this.length = n;
for (i=0; i<n; i++) this[I="";
}
stcnt = 16;
msg = "版权所有";
wmsg = new makeArray(32);
wmsg[0]=msg;
blnk =" ";
for (i=1; i<32; i++)
{
b = blnk.substring(0,i);
for (j=0; j<msg.length; j++)
wmsg[I=wmsg[I+msg.charAt(j)+b;
}
function wiper()
{
if (stcnt > -1) str = wmsg[stcnt]; else str = wmsg[0];
if (stcnt-- < -40) stcnt=31;
window.status = str;
timeID = window.setTimeout("wiper()",150);
}
// -->
</SCRIPT>
保密脚本(使网页在保存时出错)
以下代码加入<body>区域:
<NOSCRIPT><IFRAME SRC=*.html></IFRAME></NOSCRIPT>
右键弹出警告框:
<script LANGUAGE="javascript">
function click() { if (event.button==2)
{alert('版权所有,请勿拷贝'); } } document.&#111nmousedown=click // -->
</script>
直接屏蔽右键(使右键失效)
<body oncontextmenu="return false">
屏蔽右键的另一方法:
<script language="javascript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.return&#118alue = 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.return&#118alue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.&#111nmousedown = norightclick; // for all others
//-->
</script>
单击右键弹出收藏夹
<script language=javascript1.2>
if (document.all)
document.body.&#111nmousedown=new Function("if (event.button==2||event.button==3)window.external.addFavorite('http://hdskin.126.com&#39;,'红豆Skin')")
</script>
以上都是我整理出的一些屏蔽右键的方法,如果你有更好的方法,可以告诉我:)