3 回答

TA貢獻1803條經(jīng)驗 獲得超3個贊
var body = document.body, html = document.documentElement;var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
onload

TA貢獻1864條經(jīng)驗 獲得超2個贊
document.body.scrollHeight
<body>
document.documentElement.scrollHeight

TA貢獻1906條經(jīng)驗 獲得超10個贊
var B = document.body, H = document.documentElement, heightif (typeof document.height !== 'undefined') { height = document.height // For webkit browsers} else { height = Math.max( B.scrollHeight, B.offsetHeight,H.clientHeight, H.scrollHeight, H.offsetHeight );}
Math.max($(document).height(), $(window).height())
添加回答
舉報