scrollHeight, scrollWidth, scrollTop, scrollLeft 속성 예제

간격주기
결과 표시창
<SCRIPT>
function fnCheckScroll(){
  str='oDiv.scrollHeight='+oDiv.scrollHeight+'<BR>';
  str+='oDiv.scrollWidth='+oDiv.scrollWidth+'<BR>';
  str+='oDiv.scrollTop='+oDiv.scrollTop+'<BR>';
  str+='oDiv.scrollLeft='+oDiv.scrollLeft+'<BR><BR>';
  str+='document.body.scrollHeight='+document.body.scrollHeight+'<BR>';
  str+='document.bodyscrollWidth='+document.body.scrollWidth+'<BR>';
  str+='document.bodyscrollTop='+document.body.scrollTop+'<BR>';
  str+='document.bodyscrollLeft='+document.body.scrollLeft+'<BR>';
  showA.innerHTML=str;
}
</SCRIPT>
<DIV id=oDiv style="overflow:scroll; height=100; width=250; text-align:left;border:solid 1 blue;background-color:pink">
<DIV style=height:150;left:30;background:yellow>간격주기</DIV>
</DIV>
<BUTTON onclick="fnCheckScroll()">스크롤 크기</BUTTON>
<DIV id=showA style=height:11em>결과 표시창</DIV>