怎么用$('pianyi')选择器获取left和top的值
我用offset().left/offset().top获取的是相对于body的值还有其他的方法可以获取么
<div style="width:300px; height:300px; position:relative; margin-left:300px; margin-top:300px; background:#000;">
<div style="width:20px; height:20px; position:absolute; left:20px; top:20px; background:#066;" class="pianyi"></div>
</div>
我用offset().left/offset().top获取的是相对于body的值还有其他的方法可以获取么
<div style="width:300px; height:300px; position:relative; margin-left:300px; margin-top:300px; background:#000;">
<div style="width:20px; height:20px; position:absolute; left:20px; top:20px; background:#066;" class="pianyi"></div>
</div>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货