java script

창크기 구하기

디자인인스 2011. 1. 7. 11:20
브라우져의 본문의 크기는 다음과 같이 구할 수 있습니다.



window.document.body.offsetWidth
window.document.body.offsetHeight
window.document.body.clientWidth
window.document.body.clientHeight



clientWidth,clientHeight는 offsetWidth,offsetHeight와 달리 padding사이즈를 포함하지만 margin,border,scroll bar의 크기는 포함하지 않은 사이즈입니다.





※참고

window.screen.width
window.screen.height
window.screen.availWidth
window.screen.availHeight



screen객체로 해상도를 구할 수 있습니다.

availWidth,availHeight는 윈도우 task bar의 크기를 제외하고 구해집니다.

 

'java script' 카테고리의 다른 글

맨위로 이동하는 방법  (0) 2011.01.07
아이프레임 자동 리사이징 초간단  (0) 2011.01.07
재밌는 goTop  (0) 2011.01.07
탑버튼 - 스크립트로 부드럽게 이동  (0) 2011.01.07
팝업 대체용 레이어 활용  (0) 2011.01.07