Open a new window, and resize the width and height 250px relative to its current position:
More "Try it Yourself" examples below.
The resizeBy() method resizes a window by the specified amount, relative to its current size.
Note: This method moves the bottom right corner of the window by the specified number of pixels defined. The top left corner will not be moved (it stays in its original coordinates).
Related methods:
Method | |||||
---|---|---|---|---|---|
resizeBy() | Yes | Yes | Yes | Yes | Yes |
Parameter | Type | Description |
---|---|---|
width | Number | Required. A positive or a negative number that specifies how many pixels to resize the width by |
height | Number | Required. A positive or a negative number that specifies how many pixels to resize the height by |
Return Value: | No return value |
---|
Open a new window, and decrease the width by 50px and increase the height by 50px:
Using the resizeBy() method together with resizeTo():
Resize the topmost browser window with 100px each way (works only in IE and Safari):