9.4.10 jquery的CSS
position
offset
$("p").offset()
$('div').offset().top
$("p").offset().leftscrollTop
scrollLeft
//获取匹配元素相对滚动条顶部的偏移 文档被卷起的像素值
$(document).scrollTop()
$(document).scrollLeft()
//监听文档滚动的jquery方法
$(document).scroll(function(){
console.log($(document).scrollTop())
console.log($(document).scrollLeft())
})innerHeight
innerWidth
outerHeight
outerWeight
weight
height
防淘宝固定导航案例
HTML
CSS
JS
Last updated