JS中我们可以通过窗口对象的resizeBy方法动态修改窗口的大小
<!DOCTYPE html> <html> <head> <script> function resizeWindow() { top.resizeBy(100,100); } </script> </head> <body> <form> <input type="button" onclick="resizeWindow()" value="Resize window"> </form> <p><b>Note:</b> We have used the <b>top</b> element instead of the <b>window</b> element, because we use frames. If you do not use frames, use the <b>window</b> element instead.</p> </body> </html>