美文网首页
jquery尺寸相关、滚动事件

jquery尺寸相关、滚动事件

作者: 紫罗兰丶 | 来源:发表于2018-06-28 10:40 被阅读0次

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/upfgyftx.html