首页 > 不同浏览器对 document 高度的计算不同?

不同浏览器对 document 高度的计算不同?

var body = document.body,
    html = document.documentElement;

var height = Math.max( body.scrollHeight, body.offsetHeight, 
                       html.clientHeight, html.scrollHeight, html.offsetHeight );

为了获取document的高度竟然要写这么长的代码?是什么原因导致浏览器对高度的理解差异这么大?

【热门文章】
【热门文章】