-
[JavaScript] 브라우저 창 사이즈JavaScript 2022. 6. 16. 16:22
window.screen.width window.screen.height
=> 사용자의 모니터 화면의 크기를 구할 때 사용
window.outerWidth window.outerHeight
=> 해당 브라우저의 창의 크기를 구할 때 사용
window.innerWidth window.innerHeight
=> 해당 브라우저 창의 상단 사용자 인터페이스를 제외한 실제 작업 영역의 크기를 구할 때 사용 (스크롤바 영역 포함)
document.documentElement.width document.documentElement.height
=> 해당 브라우저 창의 상단 사용자 인터페이스를 제외한 실제 작업 영역의 크기를 구할 때 사용 (스크롤바 영역 포함X)
반응형'JavaScript' 카테고리의 다른 글
[JavaScript] FileReader 객체 (0) 2022.09.11 [JavaScript] use strict (0) 2022.08.30 [JavaScript] var let const 차이점 (0) 2022.08.08 [JavaScript] 키보드 이벤트: 특정키 확인 (key, code, keyCode) (0) 2022.07.18 [JavaScript] Throttle 와 Debounce (0) 2022.06.23