将窗口调整为指定的大小
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- var w;
- function openwindow() {
- w = window.open('','', 'width=100,height=100');
- w.focus();
- }
- function myFunction() {
- w.resizeTo(500, 500);
- w.focus();
- }
- </script>
- </head>
- <body>
- <button onclick="openwindow()">创建一个窗口</button>
- <button onclick="myFunction()">调整窗口大小</button>
- </body>
- </html>