<html><head>
<SCRIPT language=JavaScript1.2>
if (window.Event) // Only Netscape will have the CAPITAL E.
  document.captureEvents(Event.MOUSEUP); // catch the mouse up eventfunction nocontextmenu()  // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false; return false;
}function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
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><META http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=JavaScript1.2>
if (window.Event) // Only Netscape will have the CAPITAL E.
  document.captureEvents(Event.MOUSEUP); // catch the mouse up eventfunction nocontextmenu()  // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false; return false;
}function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
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><META NAME="description"
CONTENT="netwalk Design museum-- design in China: Design Competitions, news, gallery, digests, solon, schools, links, service, jobs, classroom and so on">
<SCRIPT language=JavaScript1.2>
if (window.Event) // Only Netscape will have the CAPITAL E.
  document.captureEvents(Event.MOUSEUP); // catch the mouse up eventfunction nocontextmenu()  // this function only applies to IE4, ignored otherwise.
{
event.cancelBubble = true
event.returnValue = false; return false;
}function norightclick(e) // This function is used by all others
{
if (window.Event) // again, IE or NAV?
{
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>
</head><body bgcolor="#750000" text="white">
屏蔽右键的完整代码!支持IE NN!!!</body>
</html>

解决方案 »

  1.   

    he he, just
    <body oncontextmenu="return false;">
      

  2.   

    发现楼上二位大哥的方法都行!!
    二位各50分~~~谢谢了~~~~请问
     ansonchen(神奇Anson) 的在各浏览器通用吗??
    另外
    如果需要在右件中弹出我自己的的菜单,屏蔽掉我不需要的项目,可以吗??
      

  3.   

    在地址栏里输入:javascript:alert(document.body.oncontextmenu="") ,你就发现<body oncontextmenu="return false;">失效了
      

  4.   

    <body oncontextmenu="return false;">
    只在IE有效果!!!!!
      

  5.   

    to net_lover(孟子E章): 别生气.....p.s.你的代码有待再简化
      

  6.   

    bencalie(Bencalie) 说的是怎么失效呢?我试了但是没用啊