Name
posLeft, posTop — NN n/a IE 4 DOM n/a
Synopsis
Read/Write
For positionable elements, define the position of the left and top
edges of an element’s box (content plus left padding, border,
and/or margin) relative to the left and top edges of the next
outermost block content container. When the element is
relative-positioned, the measure is based on the left edge of the
inline location of where the element would normally appear in the
content. Most importantly, these properties’ values are numeric
and in the unit of measure set in the CSS attribute. Use these
properties for calculation (including path animation) instead of the
left
and top
properties, which
store their values as strings with the unit names. All math is in the
specified units. Also contrast these properties with the
pixelLeft
and pixelTop
properties, which are integer values for pixel measures only.
Example
document.all.myDIV.style.posLeft = document.all.myDIV.style.posLeft + 1.5
Value
Floating-point number.
Default
None.
Get Dynamic HTML: The Definitive Reference 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.