源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>开源教程(ossoft.cn)</title> <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>
运行结果