<html>
<head>
<title></title>
<script>
function testMouse(e) { if (e.button==1) {alert("左键 : " + e.clientX + ", " + e.clientY);}
if (e.button==2) {alert("右键 : " + e.clientX + ", " + e.clientY);}
}
</script>
</head>
<body onMouseDown="testMouse(event)">
sdasdsdj
</body>
</html>
<head>
<title></title>
<script>
function testMouse(e) { if (e.button==1) {alert("左键 : " + e.clientX + ", " + e.clientY);}
if (e.button==2) {alert("右键 : " + e.clientX + ", " + e.clientY);}
}
</script>
</head>
<body onMouseDown="testMouse(event)">
sdasdsdj
</body>
</html>
{
menutitle = window.event.toElement.innerText;
//得到鼠标当前所对应的文字,以便判断是否弹出菜单
}
function document.oncontextmenu(){
alert('这就是焦点的横坐标:'+event.x+"\n这就是焦点的纵坐标:"+event.y);
event.returnValue=false;
return false;
}
</script>