Javascript examples for Browser Object Model:Window resizeBy
Window resizeBy() Method - Using the resizeBy() method together with resizeTo():
<!DOCTYPE html> <html> <body> <button onclick="openWin()">Create window</button> <button onclick="resizeWinTo()">Resize the window to 800px * 600px</button> <button onclick="resizeWinBy()">Make the new window smaller</button> <script> var myWindow;/*from w w w .java2 s . co m*/ function openWin() { myWindow = window.open("", "", "width=250, height=250"); } function resizeWinTo() { myWindow.resizeTo(800, 600); myWindow.focus(); } function resizeWinBy() { myWindow.resizeBy(-100, -50); myWindow.focus(); } </script> </body> </html>