美文网首页web入门学习
jquery尺寸相关、滚动事件

jquery尺寸相关、滚动事件

作者: 我本无常 | 来源:发表于2018-09-19 18:57 被阅读3次

1、获取和设置元素的尺寸

width()、height() 获取元素width和height
innerWidth()、innerHeight() 包括padding的width和height
outerWidth()、outerHeight() 包括padding和border的width和height
outerWidth(true)、outerHeight(true) 包括padding和border以及margin的width和height

2、获取元素相对页面的绝对位置

offse()

3、获取可视区高度

$(window).height();

4、获取页面高度

$(document).height();

5、获取页面滚动距离

(document).scrollTop();(document).scrollLeft();

6、页面滚动事件
$(window).scroll(function(){
......
})

相关文章

网友评论

    本文标题:jquery尺寸相关、滚动事件

    本文链接:https://www.haomeiwen.com/subject/qmfwnftx.html