当前位置: 首页 > 网络学院 > 客户端脚本教程 > HTML DOM > HTML DOM resizeTo() 方法
The resizeTo() method is used to resize the window to the specified width and height.
resizeTo()方法可用来将窗口的大小设置到指定的宽和高上
Note: This method does not work on dialog windows
注意:这个方法不能在窗口对话框中起到作用
resizeTo(width,height) |
Parameter 参数 | Description 描述 |
---|---|
width | Required. How many pixels to resize the width of the window to. 必选。将窗口改变到多少象素宽 |
height | Optional. How many pixels to resize the height of the window to. 可选,将窗口改变到多少象素高 |
<html> <head> <script type="text/javascript"> function resizeWindow() { window.resizeTo(500,300) } </script> </head> <body> <form> <input type="button" onclick="resizeWindow()" value="Resize window"> </form> </body> </html> |
Resize a window to a specified size
将窗口重新设置到指定的大小上