Class Index | File Index

Classes


Class Element


Defined in: element.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
The Element prototype
Field Summary
Field Attributes Field Name and Description
<private>  
Method Summary
Method Attributes Method Name and Description
<private>  
Get node attribute
<private>  
Set node attribute
 
addClass(str)
Add a class to an element
 
attr(attribute, value)
Get or set node attribute
 
connect(event_name, scope, func)
connect a function to an element's event
 
Check if an element is parent of another node
 
fire(name, properties)
Fire an arbitrary event
 
Get computed styles
 
getStyle(property)
Get Computed style
 
getStyles(styles)
Get multiples styles
 
hasClass(str)
Return true if the element has the class
 
isIn(n)
Check in an element is child of another node
 
query(selectors)
Select an array of nodes with CSS2 selector inside the element
 
setStyle(property, value)
Set style
 
setStyles(styles)
Set multiples styles
Class Detail
Element()
The Element prototype
Field Detail
<private> __name__
Method Detail
<private> __getitem__(k)
Get node attribute
Parameters:
{String} k
attribute name
Returns:
attribute value

<private> __setitem__(k, v)
Set node attribute
Parameters:
{String} k
attribute name
v
attribute value

addClass(str)
Add a class to an element
Parameters:
{String} str
Class name to add

attr(attribute, value)
Get or set node attribute
Parameters:
{String} attribute
attribute name
value Optional
attribute value
Returns:
attribute value or undefined

{py.event.Handler} connect(event_name, scope, func)
connect a function to an element's event
Parameters:
{String} event_name
The event name, NOT starting with 'on'
{Object|Function} scope
Scope object or function to execute
{Function|String} func Optional
the function to execute
Returns:
{py.event.Handler} Handler, needed to disconnect

{Boolean} contains(n)
Check if an element is parent of another node
Parameters:
{Element|String} n
node or id
Returns:
{Boolean}

fire(name, properties)
Fire an arbitrary event
Parameters:
{String} name
The event name, NOT starting with 'on'
{Object} properties Optional
Properties of the event

{Object} getComputedStyle()
Get computed styles
Returns:
{Object} Computed styles

{String} getStyle(property)
Get Computed style
Parameters:
{String} property
to get (no camel case)
Returns:
{String} Css property

getStyles(styles)
Get multiples styles
Parameters:
{String[]} styles
styles to get
See:
Element.getStyle

{Boolean} hasClass(str)
Return true if the element has the class
Parameters:
{String} str
Class name to test
Returns:
{Boolean}

{Boolean} isIn(n)
Check in an element is child of another node
Parameters:
{Element|String} n
a node or id
Returns:
{Boolean}

{Element[]} query(selectors)
Select an array of nodes with CSS2 selector inside the element
Parameters:
{String} selectors
CSS2 selectors (separated by comma)
Returns:
{Element[]} Array of nodes (possibly empty)

setStyle(property, value)
Set style
Parameters:
{String} property
Style property to alter
{String|Number} value
Property value

setStyles(styles)
Set multiples styles
Parameters:
{Object} styles
Styles to apply
See:
Element.setStyle

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