<div id="outBody"></div>
<body>
  <div id="sthAbove"></div>
  <div id="autoScroll"></div>  
</body>
 
body {
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 3px solid black;
}
#autoBody,#sthAbove {
  height: 40px;
}
#autoScroll {
  overflow-y: scroll;
}
 
$(window).resize(function() { //监听窗口大小变化 
  $("#autoScroll").css("max-height", $(window).height() - 100 + "px");
  console.log($(window).height()); //浏览器可视区域高度 
  console.log($(document).height()); //浏览器窗口文档的高度 
  console.log($(document.body).height());//浏览器窗口文档body的高度 
  console.log($(document.body).outerHeight(true));//浏览器窗口文档body的总高度 包括border padding margin
   
})
 

.outerHeight( [includeMargin ] )Returns: Integer

Description: Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.

http://api.jquery.com/outerHeight/