Layer.moveTo()

JavaScript1.2+ Nav4+ Syntax

Layer.moveTo(x,y)

Description

The moveTo() method of the Layer object moves the top-left corner of the layer object to the specified screen coordinates. The x parameter refers to an integer representing the top edge of the window in screen coordinates. The y parameter refers to an integer representing the left edge of the window in screen coordinates.

Example

Listing 7.337 shows how the moveTo() method is used. Two layers are created using the <layer> tag. When the button is clicked, the onClick event handler for layer2 invokes the moveTo method, which moves the layer to the screen coordinates 100,200.

Listing 7.337 Example of the moveTo() Method
 <html> <head> <title> Using the moveTo ...

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.