Class Index | File Index

Classes


Namespace py.dom


Defined in: dom.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
Dom utilities
Method Summary
Method Attributes Method Name and Description
<private> <static>  
py.dom._getOffsets(el)
return real position on the screen
<static>  
py.dom.attr(el, attr, val)
Set or get attribute(s) of an elements
<static>  
py.dom.byId(id)
Get element by ID
<static>  
py.dom.byName(name)
Returns elements by name (fixed version)
<static>  
py.dom.create(tag, obj)
Create an Element
<static>  
py.dom.destroyElement(node)
Destroy a node (remove it completely from the DOM)
<static>  
py.dom.getInnerLayout(element, cs)
Get box layout (inner size without padding and borders)
<static>  
py.dom.getOuterLayout(element, cs)
Get box layout including padding, borders, and margins
<static>  
py.dom.layout(el, method, set_values)
Get or set size of a node
<static>  
py.dom.setInnerLayout(element, values, cs)
Set box layout excluding padding, borders and margin
<static>  
py.dom.setOuterLayout(element, values, cs)
Set box layout including padding, borders and margin
<static>  
py.dom.style(el, if, val)
Set or get style(s) from an element
Namespace Detail
py.dom
Dom utilities
Method Detail
<private> <static> {Int[]} py.dom._getOffsets(el)
return real position on the screen
Parameters:
{Element} el
Returns:
{Int[]} left and top offset
See:
http://www.quirksmode.org/js/findpos.html

<static> py.dom.attr(el, attr, val)
Set or get attribute(s) of an elements
Parameters:
{String|Element} el
the node or node id
{Object|Array|String} attr
If it's an object, it will set all pairs to the node. If it's an array, it will return an object of attributes values. if it's a string, it will return the value or set the new one if last param val is specified
val Optional
used when set one attribute

<static> {Element} py.dom.byId(id)
Get element by ID
Parameters:
{String|Element} id
The node id
Returns:
{Element} node found or Null

<static> {Element[]} py.dom.byName(name)
Returns elements by name (fixed version)
Defined in: document.js.
Parameters:
{String} name
Node name
Returns:
{Element[]} Array of nodes

<static> {Element} py.dom.create(tag, obj)
Create an Element
Parameters:
{String} tag
Tag name
{Object|String} obj Optional
attributes of the node, or a string for content of the node
Returns:
{Element} created element

<static> py.dom.destroyElement(node)
Destroy a node (remove it completely from the DOM)
Parameters:
{Element|String} node
The node or its ID

<static> py.dom.getInnerLayout(element, cs)
Get box layout (inner size without padding and borders)
Parameters:
{Element} element
{Object} cs Optional
computed style

<static> py.dom.getOuterLayout(element, cs)
Get box layout including padding, borders, and margins
Parameters:
{Element} element
{Object} cs Optional
computed style

<static> py.dom.layout(el, method, set_values)
Get or set size of a node
Parameters:
{String|Element} el
The node
{String} method Optional, Default: 'outer'
The type of size, can be 'inner' or 'outer'
{Object} set_values Optional
Use this method as a setter, give sizes as an object

<static> py.dom.setInnerLayout(element, values, cs)
Set box layout excluding padding, borders and margin
Parameters:
{Element} element
{Object} values
{Integer} values.w Optional
width
{Integer} values.h Optional
height
{Integer} values.l Optional
left position relative to screen
{Integer} values.t Optional
top position relative to screen
{Object} cs Optional
Computed styles

<static> py.dom.setOuterLayout(element, values, cs)
Set box layout including padding, borders and margin
Parameters:
{Element} element
{Object} values
{Integer} values.w Optional
width
{Integer} values.h Optional
height
{Integer} values.l Optional
left position relative to screen
{Integer} values.t Optional
top position relative to screen
{Object} cs Optional
Computed styles

<static> py.dom.style(el, if, val)
Set or get style(s) from an element
Parameters:
{String|Element} el
The node
{Object|Array|String} if
it's an object, it will set all pairs to the node style. If it's an array, it will return an object of styles values. if it's a string, it will return the value or set the new one if last param val is specified
val Optional
used when set one style

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Jan 09 2012 11:46:58 GMT+0100 (CET)