Can someone show me how to get the top
& left
position of a div
or span
element when one is not specified?(有人可以告诉我如何在未指定div
或span
元素的情况下获取div
和span
元素的top
和left
位置?)
ie:(即:)
<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
The the value of 55px
is returned.(返回55px
的值。) However, if I try that for span
'12a', then nothing gets returned.(但是,如果我尝试span
'12a',则不会返回任何内容。)
I have a bunch of div
/ span
s on a page that I cannot specify the top
/ left
properties for, but I need to display a div
directly under that element.(我在页面上有一堆div
/ span
s,我无法指定top
/ left
属性,但我需要在该元素下直接显示div
。)
ask by schmoopy translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…