<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
html,body{
margin: 10px;
padding: 20px;
border: 5px solid #F00;
}
.parentDiv{
width: 800px;
height: 500px;
margin: 5px auto;
padding: 30px;
background-color: #F60;
border: 5px dashed #00F;
}
.childrenDiv{
width: 300px;
height: 300px;
margin: 50px auto;
padding: 5px;
background-color: #0F0;
border: 5px solid #FFF;
}
</style>
</head>
<body>
<div class="parentDiv">
<div class="childrenDiv"></div>
</div>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript">
console.log($(window).height());
console.log($(document).height());
console.log($(window).innerHeight());
console.log($(document).innerHeight());
console.log($(window).outerHeight());
console.log($(document).outerHeight());
console.log($(window).outerHeight(true));
console.log($(document).outerHeight(true));
console.log($(".childrenDiv").height());
console.log($(".childrenDiv").innerHeight());
console.log($(".childrenDiv").outerHeight());
console.log($(".childrenDiv").outerHeight(true));
$(".parentDiv").scroll(function () {
console.log($(this).scrollTop());
})
console.log($(".childrenDiv").offset().top);
console.log($(".childrenDiv").offset().left);
console.log($(".childrenDiv").position().top);
console.log($(".childrenDiv").position().top);
</script>
</body>
</html>