superxuezhazha

网页尺寸offsetHeight

offsetHeight和offsetWidth,获取网页内容高度和宽度(包括滚动条等边线,会随窗口的显示大小改变)。

一、值

offsetHeight = clientHeight + 滚动条 + 边框。

二、浏览器兼容性

var w= document.documentElement.offsetWidth
    || document.body.offsetWidth;
var h= document.documentElement.offsetHeight
    || document.body.offsetHeight;

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-09-12
  • 2022-02-24
  • 2021-09-17
  • 2021-12-19
  • 2022-01-01
  • 2021-08-30
猜你喜欢
  • 2021-11-21
  • 2021-11-21
  • 2022-02-08
  • 2022-12-23
  • 2021-12-26
  • 2021-12-26
  • 2021-12-26
相关资源
相似解决方案