Javascript examples for Browser Object Model:Window resizeBy
Window resizeBy() Method - Open a new window, and decrease the width by 50px and increase the height by 50px:
<!DOCTYPE html> <html> <body> <button onclick="openWin()">Create window</button> <button onclick="resizeWin()">Resize window</button> <script> var myWindow;/*from w w w . j av a2 s.c o m*/ function openWin() { myWindow = window.open("", "", "width=500, height=500"); } function resizeWin() { myWindow.resizeBy(-50, 50); myWindow.focus(); } </script> </body> </html>