1。获得屏幕的分辨率:
screen.width
screen.height

2。获得窗口大小:
document.body.clientWidth
document.body.clientHeight

3。获得窗口大小(包含Border、Scroll等元素)
document.body.offsetWidth
document.body.offsetHeight

div相关的一些元素详细说明可以参考这张图
JS中获得窗口属性的方法

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-07-18
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2021-06-28
  • 2022-01-03
  • 2021-09-12
  • 2021-12-10
  • 2021-07-15
  • 2021-11-30
  • 2022-12-23
相关资源
相似解决方案