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.

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

Parameters

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.

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

See Also

Reference

Sys.UI.DomElement Class

Other Resources

Language Reference