Class zwt.ui.Dimension
Extends
zwt.Object.
A dimension is used to get the computed style dimension for a given HTML element. This is a useful class to get any dimension information.
Defined in: Dimension.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.ui.Dimension(element_element)
Construct a dimension.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.ui.Dimension.ENABLE_WEBKIT_HACK
Webkit based browsers have issues determining some margin properties, using this field will let you decide when you want to use a Webkit hack to correctly determine dimension.
|
Method Attributes | Method Name and Description |
---|---|
absHeight(boolean_reset)
Return the element's absolute height (= userHeight + padding + border).
|
|
absWidth(boolean_reset)
Return the element's absolute width (= userWidth + padding + border).
|
|
borderBottom(boolean_reset)
Return the element's border bottom.
|
|
borderLeft(boolean_reset)
Return the element's border left.
|
|
borderRight(boolean_reset)
Return the element's border right.
|
|
borderTop(boolean_reset)
Return the element's border top.
|
|
left()
Return the element's left position.
|
|
marginBottom(boolean_reset)
Return the element's margin bottom.
|
|
marginLeft(boolean_reset)
Return the element's margin left.
|
|
marginRight(boolean_reset)
Return the element's margin right.
|
|
marginTop(boolean_reset)
Return the element's margin top.
|
|
overflow()
Return the element's overflow.
|
|
paddingBottom(boolean_reset)
Return the element's padding bottom.
|
|
paddingLeft(boolean_reset)
Return the element's padding left.
|
|
paddingRight(boolean_reset)
Return the element's padding right.
|
|
paddingTop(boolean_reset)
Return the element's padding top.
|
|
realHeight(boolean_reset)
Return the element's real height (= userHeight + padding).
|
|
realWidth(boolean_reset)
Return the element's real width (= userWidth + padding).
|
|
reset()
Reset all cached values in the dimension object.
|
|
scrollHeight(boolean_reset)
Return the element's scroll height.
|
|
scrollWidth(boolean_reset)
Return the element's scroll width.
|
|
top()
Return the element's top position.
|
|
userHeight(boolean_reset)
Return the element's user height which is the value of the height property (in px) specified in the style properties of the element.
|
|
userLeft(boolean_reset)
Return the element's user left which is the value of the left property (in px) specified in the style properties of the element.
|
|
userTop(boolean_reset)
Return the element's user top which is the value of the top property (in px) specified in the style properties of the element.
|
|
userWidth(boolean_reset)
Return the element's user width which is the value of the height property (in px) specified in the style properties of the element.
|
Class Detail
zwt.ui.Dimension(element_element)
Construct a dimension.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {Element} element_element
- An HTML element.
Field Detail
<static>
{Boolean}
zwt.ui.Dimension.ENABLE_WEBKIT_HACK
Webkit based browsers have issues determining some margin properties, using this field will let you decide when you want to use a Webkit hack to correctly determine dimension.
Method Detail
{Integer}
absHeight(boolean_reset)
Return the element's absolute height (= userHeight + padding + border).
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the absolute height
{Integer}
absWidth(boolean_reset)
Return the element's absolute width (= userWidth + padding + border).
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the absolute width
{Integer}
borderBottom(boolean_reset)
Return the element's border bottom.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the border bottom
{Integer}
borderLeft(boolean_reset)
Return the element's border left.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the border left
{Integer}
borderRight(boolean_reset)
Return the element's border right.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the border right
{Integer}
borderTop(boolean_reset)
Return the element's border top.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the border top
{Integer}
left()
Return the element's left position.
- Returns:
- the left position
{Integer}
marginBottom(boolean_reset)
Return the element's margin bottom.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the margin bottom
{Integer}
marginLeft(boolean_reset)
Return the element's margin left.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the margin left
{Integer}
marginRight(boolean_reset)
Return the element's margin right.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the margin right
{Integer}
marginTop(boolean_reset)
Return the element's margin top.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the margin top
{String}
overflow()
Return the element's overflow.
- Returns:
- the overflow
{Integer}
paddingBottom(boolean_reset)
Return the element's padding bottom.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the padding bottom
{Integer}
paddingLeft(boolean_reset)
Return the element's padding left.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the padding left
{Integer}
paddingRight(boolean_reset)
Return the element's padding right.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the padding right
{Integer}
paddingTop(boolean_reset)
Return the element's padding top.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the padding top
{Integer}
realHeight(boolean_reset)
Return the element's real height (= userHeight + padding).
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the real height
{Integer}
realWidth(boolean_reset)
Return the element's real width (= userWidth + padding).
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the real width
reset()
Reset all cached values in the dimension object.
{Integer}
scrollHeight(boolean_reset)
Return the element's scroll height.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the scroll height
{Integer}
scrollWidth(boolean_reset)
Return the element's scroll width.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the scroll width
{Integer}
top()
Return the element's top position.
- Returns:
- the top position
{Integer}
userHeight(boolean_reset)
Return the element's user height which is the value of the height property (in px) specified in the style properties of the element.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the user height
{Integer}
userLeft(boolean_reset)
Return the element's user left which is the value of the left property (in px) specified in the style properties of the element.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the user left
{Integer}
userTop(boolean_reset)
Return the element's user top which is the value of the top property (in px) specified in the style properties of the element.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the user top
{Integer}
userWidth(boolean_reset)
Return the element's user width which is the value of the height property (in px) specified in the style properties of the element.
- Parameters:
- {Boolean} boolean_reset
- true to recalculate the value, false to return the cached value. The cached value is returned if nothing is specified
- Returns:
- the user width