Hemi JavaScript Framework
Hemi.css
Description
The CSS Utility class includes tools for positioning, importing external stylesheets, and enabling and disabling stylesheets.
static Hemi.css
version 3.1.9
Utilities for DOM Styles and Cascading Style Sheets.
Index
Method Index
- public decodeJSON: Returns an object from the encoded construct. The accepted pattern is: {#HF_NAME{name:value}}, and the returned value is an object whose first member is NAME and whose children is the encoded data. For example: {#HF_Test{data:1}} would yield: {Test:{data:1}}, as a JavaScript object.
- public getAbsoluteLeft: Returns the absolute left position of the specified node.
- public getAbsolutePosition (internal): Returns the absolute position of the specified node.
- public getAbsoluteTop: Returns the absolute top position of the specified node.
- public loadStyleSheet: Imports the specified stylesheet.
- public toggleStyleSheet: Enables or disables the specified external stylesheet.
Methods
decodeJSON
Returns an object from the encoded construct. The accepted pattern is: {#HF_NAME{name:value}}, and the returned value is an object whose first member is NAME and whose children is the encoded data. For example: {#HF_Test{data:1}} would yield: {Test:{data:1}}, as a JavaScript object.
Syntax
o = decodeJSON(
s
)
Parameters
- s as String : An encoded JSON-esque string.
Returns
o as Object: The decoded object.
getAbsoluteLeft
Returns the absolute left position of the specified node.
Syntax
i = getAbsoluteLeft(
o, r
)
Parameters
- o as object : Source DOM Node.
- r as object (optional): Reference DOM Node.
Returns
i as int: The absolute left of the specified object from the parent window.
getAbsolutePosition
Returns the absolute position of the specified node.
Syntax
i = getAbsolutePosition(
o, r, b
)
Parameters
- o as object : Source DOM Node.
- r as object (optional): Reference DOM Node.
- b as boolean : Bit indicating the position type
Returns
i as int: The absolute position of the specified object from the parent window.
getAbsoluteTop
Returns the absolute top position of the specified node.
Syntax
i = getAbsoluteTop(
o, r
)
Parameters
- o as object : Source DOM Node.
- r as object (optional): Reference DOM Node.
Returns
i as int: The absolute top of the specified object from the parent window.
loadStyleSheet
Imports the specified stylesheet.
Syntax
void loadStyleSheet(
sUrl, sName
)
Parameters
- sUrl as String : Path to the external stylesheet. Default root path is Hemi.base_path.
- sName as String (optional): Name of the stylesheet.
toggleStyleSheet
Enables or disables the specified external stylesheet.
Syntax
void toggleStyleSheet(
sTitle, bEnable
)
Parameters
- sTitle as String : Name of the stylesheet link.
- bEnable as boolean : Bit indicating whether the stylesheet should be enabled.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2011. ]