window.resizeTo()

JavaScript1.2+, JScript3.0+ Nav4+, IE4+ Syntax

							window.resizeTo(numWidth, numHeight)

Description

The resizeTo() method of the Window object resizes the specified window to the specified size passed to the method. As shown in the syntax definition, the first numeric value passed to the method represents the width you want to size the window to, while the second numeric value represents the height.

Example

Listing 7.576 has two text fields and a button. If the user enters an integer value in each of the text fields and clicks the button, the window will resize to those settings.

Listing 7.576 Using the resizeTo() Method to Resize the Window
 <html> <head> <script language="JavaScript1.2"> <!-- Hide // Define a function ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.