function test(e){
oEvent = document.all ? window.event : e ; 
mouseX = oEvent.clientX; 
mouseY = oEvent.clientY;
alert(mouseX);
}
//-->
</script>
<a href="#" onmouseover="test()" >test</a>刚才没贴上来代码

解决方案 »

  1.   


    function test(e){
        oEvent = window.event || e ; 
        mouseX = oEvent.clientX; 
        mouseY = oEvent.clientY;
        alert(mouseX);
    }
    //-->
    </script>
    <a href="#" onmouseover="test(event)" >test</a>
      

  2.   

    <a href="#" onmouseover="test(event)" >test</a>
      

  3.   

    不好意思,还要问一下,为什么<a id="a1" href="#" onmouseover="test(event)" >test</a> 这样传参数必须要传event 换一个名字就不行了。
    而在函数里面function test(e){}这个参数可以是随便的呢?
      

  4.   

    http://topic.csdn.net/u/20080303/16/ad3e52a5-4386-475e-ad3d-a9fa862b20cb.html
    可以参考这里我三楼和五楼的回复.