最佳答案
有人能告诉我如何得到的 top和 left位置的 div或 span元素时,没有指定一个?
即:
<span id='11a' style='top:55px;' onmouseover="GetPos(this);">stuff</span>
<span id='12a' onmouseover="GetPos(this);">stuff</span>
In the above, if I do:
document.getElementById('11a').style.top
返回 55px的值。但是,如果对 span’12a’尝试返回该值,则不返回任何值。
我在一个页面上有很多 div/span,我不能指定它们的 top/left属性,但是我需要在这个元素下面直接显示一个 div。