什么是 jQuery(或 JavaScript)中正确的标记来获取 DOM 中元素的样式属性“位置”?
例子:
HTML
<div id="Parent">
Parent Element
<ul class="child">
<li>
<p>inner child elements</p>
</li>
</ul>
</div>
CSS
#Parent {
position: relative;
}
.child {
position: absolute;
}
JavaScript:
$(function() {
// What to type here to get "style attribute position" of say #Parent?
})