offset scroll

offset  是到网页最左上角 0.0 的边距

获取方法:

$(".a1").offset() 获取的是对象 

$(".a3").offset().top 获取 top值 Number

$(".a3").offset().left

$(".a4")[0].offsetWidth 获取元素的宽度

原文地址:https://www.cnblogs.com/nice2018/p/9969831.html