window.moveTo()

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

							window.moveTo(numX, numY)

Description

The moveTo() method of the Window object, moves the specified window to the specified location passed to the method. As shown in the syntax definition, the first numeric value passed to the method represents the x-coordinate to which you want to move the window, while the second numeric value represents the y-coordinate.

Example

Listing 7.553 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 move to that location.

Listing 7.553 Using the moveTo() Method to Move the Location of a Window
 <html> <head> </head> <script language="JavaScript1.2"> <!-- Hide ...

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.