Window resizeBy() method
- Previous Page prompt()
- Next Page resizeTo()
- Go to the Previous Level Window Object
Definition and Usage
resizeBy()
The method adjusts the window size by the specified amount.
See also:
Instance
Example 1
Open a new window and adjust (increase) the width and height:
function openWin() { myWindow = window.open("", "", "width=100, height=100"); } function resizeWin() { myWindow.resizeBy(250, 250); }
Example 2
Open a new window, decrease the width by 50px, and increase the height by 50px:
myWindow.resizeBy(-50, 50);
Example 3
Combine resizeBy() with resizeTo():
function resizeWinTo() { myWindow.resizeTo(800, 600); myWindow.focus(); } function resizeWinBy() { myWindow.resizeBy(-100, -50); }
Syntax
resizeBy(width, height)
Parameter
Parameter | Description |
---|---|
width | Mandatory. Positive or negative number. The number of pixels to adjust the width size. |
height | Required. A positive or negative number. The number of pixels to adjust the height size. |
Return Value
None.
Browser Support
All Browsers Support resizeBy()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page prompt()
- Next Page resizeTo()
- Go to the Previous Level Window Object