Window resizeTo() 方法
- Previous Page resizeBy()
- Next Page screen
- Go Back to the Previous Level Object ng Window
实例
打开新窗口,并将其调整为 300 x 300:
function openWin() { myWindow = window.open("", "", "width=200, height=100"); } function resizeWin() { myWindow.resizeTo(300, 300); }Example
将 resizeTo() 与 resizeBy() 一起使用:
function resizeWinTo() { myWindow.resizeTo(800, 600); } function resizeWinBy() { myWindow.resizeBy(-100, -50); }
语法
window.resizeTo(width, height)
Parameter
Parameter | 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 Back to the Previous Level Object ng Window