获取页面高度

5年以前  |  阅读数:395 次  |  编程语言:JavaScript 
function getPageHeight() {
  var g = document,
    a = g.body,
    f = g.documentElement,
    d = g.compatMode == "BackCompat" ? a : g.documentElement;
  return Math.max(f.scrollHeight, a.scrollHeight, d.clientHeight);
}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8