求IE中禁止鼠标右键的具体做法

来源:百度知道 编辑:UC知道 时间:2024/05/24 08:39:53
就是在网页源码<body>和</body>间加入代码如下:
<body leftmargin=0 topmargin=0 onmousemove='HideMenu()' oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()">
不知道是不是这个代码,希望高手能告诉我具体做法```谢谢啦 如果代码错误就告诉我正确的代码啦,谢谢
就是IE中禁止鼠标右键。。。
可否告诉我具体如何操作吗?谢谢

是的,还有其他的
<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>