画一个简图帮助直观理解Javascript获取屏幕,页面,浏览器的高度的方法:
var body = document.body, html = document.documentElement; var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );