정미나닷컴

[JavaScript] Dimension 본문

programming

[JavaScript] Dimension

정미나 2012. 7. 3. 15:33
반응형

* innerWidth 브라우저 창의 가로 길이(사용자 가시폭)

width = top.window.innerWidth;

 

* innHeight 브라우저 창의 세로 길이(사용자 가시폭)

height = top.window.innHeight;

 

* offsetHeight 브라우저 창의 세로 길이(사용자 가시폭)
height = document.documentElement.offsetHeight;

 
* offsetWidth 브라우저 창의 가로 길이(사용자 가시폭) 
width = document.documentElement.offsetWidth;

* clientHeight 브라우저 창의 세로 길이(사용자 가시폭) 
height = document.documentElement.clientHieght;
 
* clientWidth 브라우저 창의 가로 길이(사용자 가시폭)

width = document.documentElement.clientWidth;
 

* scrollHeight 전체 페이지의 세로 길이 
heigth = document.documentElement.scrollHeight;
 

* scrollLeft 전체 페이지의 왼쪽 시작점

left = document.documentElement.scrollLeft;

 
* scrollTop 브라우저 창의 top 위치(스크롤의 움직임에 따라 가변적)

top = document.documentElement.scrollTop;

top = document.body.scrollTop; (크롬)
 

* scrollWidth 브라우저 창의 가로 길이(사용자 가시폭)
width = document.documentElement.scrollWidth;
 

screen.availHeight / screen.availWidth 모니터전체사이즈(해상도)
 

 

반응형