Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Sys.UI.DomElement setLocation Method

Sets the position of a DOM element. This member is static and can be invoked without creating an instance of the class.

Syntax

Sys.UI.DomElement.setLocation(element, x, y);

Term

Definition

element

The target element.

x

The x-coordinate in pixels.

y

The y-coordinate in pixels.

Remarks

The left and top style attributes (upper-left corner) of an element specify the relative position of an element. The actual position will depend on the offsetParent property of the target element and the positioning mode of the element.

Example

The following example shows how to use the setLocation method. This code is part of a larger example found in the Sys.UI.DomElement class overview.

cs

// Move the element
Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y);

vb

// Move the element
Sys.UI.DomElement.setLocation(elementRef, 100, elementLoc.y);