wxcbg

$(window).height() 和 $(document).height()的区别

$(window).height()代表了当前可见区域的大小,
$(document).height()则代表了整个文档的高度,可视具体情况使用.

当浏览器窗口大小改变时(如最大化或拉大窗口后) ,
$(window).height() 随之改变,但是 $(document).height()是不变的。

 

原生js里获取页面高度和文档高度

document.body.clientHeight相当于$(window).height()

document.body.scrollHeight相当于$(document).height()

 

分类:

技术点:

相关文章:

  • 2021-09-01
  • 2021-07-24
  • 2021-12-04
猜你喜欢
  • 2021-12-23
  • 2021-11-30
  • 2021-11-30
  • 2022-02-07
  • 2022-01-02
相关资源
相似解决方案