Window.resizeTo()
메서드는 동적으로 창의 크기를 변경합니다.
구문
window.resizeTo(width, height)
매개변수
width
- 새로운
outerWidth
를 나타내는 픽셀 단위 정수. 스크롤 바, 제목 표시줄 등을 모두 포함한 너비입니다. height
- 새로운
outerHeight
를 나타내는 픽셀 단위 정수. 스크롤 바, 제목 표시줄 등을 모두 포함한 높이입니다.
예제
다음 함수는 창의 크기를 화면에서 사용 가능한 크기의 1/4로 설정합니다. Screen.availWidth
, Screen.availHeight
속성도 참고하세요.
function quarter() {
window.resizeTo(
window.screen.availWidth / 2,
window.screen.availHeight / 2
);
}
명세
Specification | Status | Comment |
---|---|---|
CSS Object Model (CSSOM) View Module The definition of 'window.resizeTo()' in that specification. |
Working Draft |
브라우저 호환성
BCD tables only load in the browser
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.