Core.Web
VirtualPosition
Class Hierarchy:

Static object/namespace which provides cross-platform CSS positioning capabilities. Do not instantiate.

Internet Explorer 6 is ordinarily handicapped by its lack of support for setting 'left' and 'right' or 'top' and 'bottom' positions simultaneously on a single document element.

To use virtual positioning, simply set the left/right/top/bottom coordinates of an element and invoke redraw(). The redraw() method must be invoked whenever the size of the element should be redrawn, e.g., when the screen or its containing element resizes.


Class Field Summary
Internal _OFFSETS_VERTICAL
Internal _OFFSETS_HORIZONTAL
Internal _enabled
Flag indicating whether virtual positioning is required/enabled.

Class Method Summary
Internal _calculateOffsets()
Calculates horizontal or vertical padding, border, and margin offsets for a particular style.
Internal _init()
Enables and initializes the virtual positioning system.
Public redraw()
Redraws elements registered with the virtual positioning system.
Internal _verifyPixelValue()
Determines if the specified value contains a pixel dimension, e.

Class Method Detail
_calculateOffsets
Calculates horizontal or vertical padding, border, and margin offsets for a particular style.
Parameters:
offsetNames - the names of the offsets styles to calculate, either _OFFSETS_VERTICAL or _OFFSETS_HORIZONTAL.
style - the style whose offsets should be calculated
Returns:
the pixel size of the offsets, or -1 if they cannot be calculated

_init
Enables and initializes the virtual positioning system.

redraw
Redraws elements registered with the virtual positioning system. Adjusts the style.height and style.width attributes of an element to simulate its specified top, bottom, left, and right CSS position settings The calculation makes allowances for padding, margin, and border width.
Parameters:
element - the element to redraw

_verifyPixelValue
Determines if the specified value contains a pixel dimension, e.g., "20px" Returns false if the value is null/whitespace/undefined.
Parameters:
value - the value to evaluate
Returns:
true if the value is a pixel dimension, false if it is not