<script>
function f1()
{
alert("x="+window.event.x+",y="+window.event.y);
}
</script>
<DIV>
<P>M
<input type=text onmouseover ="f1()" ID=s>.</DIV>
function f1()
{
alert("x="+window.event.x+",y="+window.event.y);
}
</script>
<DIV>
<P>M
<input type=text onmouseover ="f1()" ID=s>.</DIV>
我也不知道如何得到控件对于窗口的坐标。似乎需要一层层向上查找到窗口一级。
你的方法我也試過。
但這個方法得到的坐標不準,例如:鼠標從上面移到這個控件與鼠標從下面移到這個控件得到的 Y 值是不一樣的。