Window resizeTo() Method
- Previous Page resizeBy()
- Next Page screen
- Go to the Previous Level Window Object
Definition and Usage
resizeTo()
The method adjusts the window size to the new width and height.
See also:
Example
Open a new window and resize it to 300 x 300:
function openWin() { myWindow = window.open("", "", "width=200, height=100"); } function resizeWin() { myWindow.resizeTo(300, 300); }Example
Use resizeTo() with resizeBy():
function resizeWinTo() { myWindow.resizeTo(800, 600); } function resizeWinBy() { myWindow.resizeBy(-100, -50); }
Syntax
window.resizeTo(width, height)
Parameters
Parameters | Description |
---|---|
width | Required. New window width in pixels. |
height | Required. New window height in pixels. |
Return Value
None.
Browser Support
All Browsers Support resizeTo()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page resizeBy()
- Next Page screen
- Go to the Previous Level Window Object