offsetTop是指当前单元格与表顶部的距离.下面的代码试试就知道了.
<table cellpadding="0" cellspacing="0" border="1" style="POSITION: absolute; top:120; left:500; height: 90;">
<tr>
<td>dfdf</td>
</tr>
<tr>
<td>dfdf</td>
</tr>
<tr>
<td onclick="alert(this.offsetTop)">dfdf</td>
</tr>
</table>

解决方案 »

  1.   

    我明白你想要什么,请看
    alert(this.offsetTop+this.clientHeigh)
      

  2.   

    真接用
    alert(this.clientHeigh)就可以了.
      

  3.   

    oRect = obj.getBoundingClientRect();
    x=oRect.left;
    y=oRect.top+main.scrollTop;用这个绝对定位,main.scrollTop获取Body滚动的距离,这样就很精确了
      

  4.   

    offsetTop:
    Retrieves the calculated top position of the Tag relative to the layout or coordinate parent, as specified by the offsetParent property.
    -------
    即:offset是相对于它的offsetParent来的,并不是相对body的位置,
    <table cellpadding="0" cellspacing="0" border="1" style="POSITION: absolute;top:100;left:100">
    <tr>
    <td>dfdf</td>
    </tr>
    <tr>
    <td onclick="alert(this.offsetTop+this.offsetParent.offsetTop)">dfdf</td>
    </tr>
    </table>