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