창 크기 조정By()
실시예 1
새 창을 열고 너비와 높이의 크기를 조정(증가)합니다.
function openWin() {
myWindow = window.open("", "", "width=100, height=100");
}
function resizeWin() {
myWindow.resizeBy(250, 250);
}
아래에 더 많은 예가 있습니다.
정의 및 사용
이 resizeBy()
메서드는 지정된 양만큼 창의 크기를 조정합니다.
통사론
resizeBy(width, height)
매개변수
Parameter | Description |
width | Required. A positive or a negative number. The number of pixels to resize the width by. |
height | Required. A positive or a negative number. The number of pixels to resize the height by. |
반환 값
없음 |
더 많은 예
새 창을 열고 너비를 50px 줄이고 높이를 50px 늘립니다.
myWindow.resizeBy(-50, 50);
resizeTo()와 함께 resizeBy() 사용:
function resizeWinTo() {
myWindow.resizeTo(800, 600);
myWindow.focus();
}
function resizeWinBy() {
myWindow.resizeBy(-100, -50);
}
브라우저 지원
resizeBy()
모든 브라우저에서 지원됩니다:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |