<HTML>
<HEAD>
<TITLE>鼠标右键将不起作用!!!</TITLE>
<script language="JavaScript1.2">
if (window.Event)
document.captureEvents(Event.MOUSEUP); function nocontextmenu()
{
Layer1.style.left = event.clientX + document.body.scrollLeft;
Layer1.style.top = event.clientY + document.body.scrollTop;
Layer1.style.visibility = "visible";
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;
}
else
if(event.button==1)
{
if(event.srcElement.nodeName=="BODY")
if(Layer1.style.visibility == "visible")
Layer1.style.visibility="hidden";
}
}document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
</script>
</HEAD><BODY BGCOLOR="#FFFFFF">
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:73px; height:73px; z-index:1; visibility: hidden">
<table border="1" cellspacing="1" cellpadding="1" width="100%" bordercolor="#999999">
<tr>
<td align="center">菜单一</td>
</tr>
<tr>
<td align="center">菜单二</td>
</tr>
<tr>
<td align="center">菜单三</td>
</tr>
<tr>
<td align="center">菜单四</td>
</tr>
</table>
</div>
鼠标右键将不起作用!!!
</BODY>
</HTML>
<HEAD>
<TITLE>鼠标右键将不起作用!!!</TITLE>
<script language="JavaScript1.2">
if (window.Event)
document.captureEvents(Event.MOUSEUP); function nocontextmenu()
{
Layer1.style.left = event.clientX + document.body.scrollLeft;
Layer1.style.top = event.clientY + document.body.scrollTop;
Layer1.style.visibility = "visible";
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;
}
else
if(event.button==1)
{
if(event.srcElement.nodeName=="BODY")
if(Layer1.style.visibility == "visible")
Layer1.style.visibility="hidden";
}
}document.oncontextmenu = nocontextmenu;
document.onmousedown = norightclick;
</script>
</HEAD><BODY BGCOLOR="#FFFFFF">
<div id="Layer1" style="position:absolute; left:0px; top:0px; width:73px; height:73px; z-index:1; visibility: hidden">
<table border="1" cellspacing="1" cellpadding="1" width="100%" bordercolor="#999999">
<tr>
<td align="center">菜单一</td>
</tr>
<tr>
<td align="center">菜单二</td>
</tr>
<tr>
<td align="center">菜单三</td>
</tr>
<tr>
<td align="center">菜单四</td>
</tr>
</table>
</div>
鼠标右键将不起作用!!!
</BODY>
</HTML>
<!--
.css1{background:c0c0c0;color:000000}
.css2{background:ffffff;color:000000}
-->
</style>
<script>
<!--
function showhidden(){
if(event.button==2){showMenu()}
else{hidden()}
}
function showMenu(){
var e=event.srcElement;
menu.style.top=window.event.clientY
menu.style.left=window.event.clientX
menu.style.visibility='visible';
}
function hidden(){
menu.style.visibility='hidden'
menu.style.left=0
menu.style.top=0
}
document.onmousedown=showhidden;
-->
</script>
<body oncontextmenu="return false">
<div style="position:absolute;left:0;top:0;width:100;backgroundr:c0c0c0;visibility:hidden;border:1px outset black" id='menu'>
<div onmouseover="this.className='css1'" onmouseout="this.className='css2'" style="padding:1;width:100%;border:1px outset">你好</div>
<div onmouseover="this.className='css1'" onmouseout="this.className='css2'" style="padding:1;width:100%;border:1px outset">他好</div>
<div onmouseover="this.className='css1'" onmouseout="this.className='css2'" style="padding:1;width:100%;border:1px outset">我好</div>
</div></body>