App下載
首頁javascriptheightjQuery Style - 如何檢查文檔高度和窗口高度之間的差異

jQuery Style - 如何檢查文檔高度和窗口高度之間的差異

我們想知道如何檢查文檔高度和窗口高度之間的差異。

    
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.7.1.js'></script>
<script type='text/javascript'>
$(window).load(function(){
    console.log ($(document).height() - $(window).height());
});
</script>
</head>
<body>
</body>
</html>