$(window).height() 和 $(document).height()的區別
$(window).height()代表了當前可見區域的大小,
$(document).height()則代表了整個文檔的高度,可視具體情況使用.
當瀏覽器窗口大小改變時(如最大化或拉大窗口后) ,
$(window).height() 隨之改變,但是 $(document).height()是不變的。
原生js里獲取頁面高度和文檔高度
document.body.clientHeight相當於$(window).height()
document.body.scrollHeight相當於$(document).height()