나는 생각한다
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<div>Testing</div>
<div id="result" style="margin:1em 4em; background:rgb(200,200,255); height:500px"></div>
<div style="background:rgb(200,255,200); height:3000px; width:5000px;"></div>
<script>
(function(){
var link=$("#result");
var top = link.offset().top;
var bottom = top + link.height();
var left = link.offset().left;
var right = left + link.width();
var bottomFromBottom = $(document).height() - bottom;
var rightFromRight = $(document).width() - right;
var str="";
str+="top: "+top+"<br>";
str+="bottom: "+bottom+"<br>";
str+="left: "+left+"<br>";
str+="right: "+right+"<br>";
str+="bottomFromBottom: "+bottomFromBottom+"<br>";
str+="rightFromRight: "+rightFromRight+"<br>";
link.html(str);
})();
</script>
결과는
top: 44
bottom: 544
left: 72
right: 1277
bottomFromBottom: 3068
rightFromRight: 3731
내 크롬 브라우저에서.
문서를 스크롤 할 수있는 경우 스크롤에서 $(window).height()일부가 숨겨져있는 문서의 너비가 아닌 브라우저 뷰포트의 높이를 반환합니다. http://api.jquery.com/height/를 참조하십시오 .