Javascript examples for Browser Object Model:Window resizeBy
The resizeBy() method resizes a window relative to its current size.
Parameter | Type | Description |
---|---|---|
width | Number | Required. A positive or a negative number in pixels to resize the width by |
height | Number | Required. A positive or a negative number in pixels to resize the height by |
No return value
The following code shows how to Open a new window, and resize the width and height 250px relative to its current position:
<!DOCTYPE html> <html> <body> <button onclick="resizeWin()">Resize window</button> <script> function resizeWin() {//from www .ja v a 2s . c o m top.resizeBy(100, 100); } </script> </body> </html>