body {background-color: #c3c3c3}

offset scroll

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

获取方法:

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

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

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

 

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

posted @ 2018-11-16 16:00  最美胡萝卜  阅读(93)  评论(0编辑  收藏  举报
body {background-color: #c3c3c3}