element.position(x, y, [opt])
Set the element position to x
and y
coordinates. This is almost equivalent to
element.set('position', { x: x, y: y }, opt)
. However, this method provides some additional functionality.
If you set opt.parentRelative
flag to true
, the x
and y
coordinates will be treated relatively to the parent element of this element. If position()
is called
without arguments, it returns the current position. If position({ parentRealtive: true })
is called
without x
and y
coordinates and with the parentRelative
flag set to true
,
the method returns the current position of the element relative to its parent.