Code
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
//滑鼠右鍵事件
function rightclk(tem,evt)
{
alert(evt)
evt = evt ? evt : (window.event ? window.event : null);
// var isie=document.all;
var rightnum=window.event?event.button:evt.button;
//var temp=evt.button;
// alert("temp:"+temp);
alert("rightnum:"+rightnum);
/*注:ie中右鍵的值是1右鍵的值是4中鍵的值是2 firefox中左鍵的值1 右鍵的值是3 中鍵的值是2*/
if (rightnum==2)
{
alert("!isie && rightnum==2");
//進行快顯功能表操作
}else if(rightnum==3)
{
alert("!isie && rightnum==3");
//進行快顯功能表操作
}else{
//其它索引值抓取
alert("else");
}
}
//document.onmousedown=rightclk;
function gotoSubmit(evt) {
evt = evt ? evt : (window.event ? window.event : null);
alert(evt); // use evt
}
</script>
</head>
<body>
<span onmousedown="javascript:rightclk(event)">右鍵事件 </span>
<input type="button" name="someButton" value="提交" onclick="javascript:gotoSubmit(event)" />
</body>
</html>