:: Documentation >>

setPosition

Sets element position.

null

Syntax

obj.setPosition(left, top);

Parameters

left (number) - element left position in pixels
top (number) - element top position in pixels

Example

obj.setPosition(100, 200);

Remarks

The parameters for this method should be numeric values which are interpreted as pixels. This method does not allow using % or em values. For other units just call setStyle() method directly.

This method also adds position:absolute to the element styles and left/top values behave according to CSS absolute positioning rules.

See also

setSize() method

Comments

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5