PHP2Go Javascript Framework

Class Element

Object
   |
   +--Element

class Element


Element
Defined in dom.js


Field Summary
<private>  Object elm
          
<static>  Number BORDER_BOX
          Border box
<static>  Number CONTENT_BOX
          Content box
<static>  Number MARGIN_BOX
          Margin box
<static>  Number PADDING_BOX
          Padding box
 
Constructor Summary
Element (name, parent, style, html, attrs)
            The Element class contains methods that can be applied to any DOM element through the $ and $E functions
 
Method Summary
 Object addClass(<String> cl)
           Adds a CSS class on the element
 Object clear(<Boolean> useDom)
           Remove all HTML contents from the element
 Boolean empty()
           Verify if the element is empty
 Number getBorder(<String> side)
           Get the element's border value for a given side
 Object getBorderBox()
           Get the element's border box
 Array getChildNodes()
           Collects the element's child nodes, skipping all text nodes.
 String getComputedStyle(<String> prop)
           Retrieves the computed value of a given style property
 Object getComputedStyles()
           Gets all computed styles of the element
 Object getDimensions()
           Get the dimensions of the element.
 Array getElementsByClassName(clsNames)
           Search for all elements that match the given set of class names
 String getInnerText()
           Collects the contents of all text nodes inside the element
 Array getNextSiblings()
           Get the element's next siblings
 Number getOpacity()
           Gets the element's opacity level.
 Object getPaddingBox()
           Get the element's padding box
 Object getParentByTagName(<String> tag)
           Finds an element's ancestor by tag name
 Array getParentNodes()
           Collects the ancestor nodes of the element
 Object getPosition(<Number> tbt)
           Retrieve the absolute position of the element.
 Array getPreviousSiblings()
           Get the element's previous siblings
 Array getSiblings()
           Get all element's siblings
 Object getStyle(<String> prop)
           Reads a style property of the element.
 String getTag()
           Get the element's tag
 Boolean hasAttribute(<String> attr)
           Checks if the element has a given attribute.
 Boolean hasClass(<String> cl)
           Checks if the element contains a given CSS class
 Object hide()
           Hides the element
 Object insert(<String> ins, position, <Boolean> evalScripts)
           Inserts HTML code inside the element.
 Object insertAfter(ref)
           Insert the node after a given reference node.
 Boolean isChildOf(<Object> anc)
           Checks if the element is child of a given element
 Boolean isVisible()
           Verify if the element is visible
 Object isWithin(<Object> p1, <Object> p2)
           Checks if the element is within a given pair of coordinates.
 Object moveTo(<Number> x, <Number> y)
           Moves the element to the given x and y coordinates
 Object readAttribute(<String> attr)
           Reads the value of an element's attribute
 Array recursivelyCollect(<String> prop)
           Recursively collects elements associated by the 'prop' property
 Number recursivelySum(<String> prop)
           Recursively sums the values of a given property on all ancestors of the element
 Object remove()
           Remove the element from its parent node
 Object removeClass(<String> cl)
           Removes a CSS class from the element
 Object replace(<Object> rep, evalScripts)
           Replaces the element with the given HTML code
 Object resizeTo(<Number> w, <Number> h)
           Resizes the element to the given width and height values
 Object scrollTo()
           Scrolls the window to the element's position
 Object setInnerText(<String> text)
           Defines the text content of the element
 Object setOpacity(<Number> op)
           Sets the element's opacity level.
 Object setParentNode(<Object> p)
           Sets the element's parent node.
 Object setStyle(<Object> prop, <Object> value)
           Set one or more style properties of the element
 Object show()
           Shows the element
 Object swapStyles(<Object> props, <Function> func)
           Swaps in/out style properties in order to call a given function
 Object toggleClass(<String> cl)
           Adds/removes a CSS class on the element
 Object toggleDisplay()
           Toggles the element's visibility
 Object update(<Object> upd, <Boolean> evalScripts, <Boolean> useDom)
           Set the HTML contents of the element.
 Object writeAttribute(<Object> attr, <Object> value)
           Writes one or more element's attributes
<static> void extend(<Object> props)
           Adds a list of methods to the element extensions.

Field Detail

elm

<private> Object elm

BORDER_BOX

<static> Number BORDER_BOX

CONTENT_BOX

<static> Number CONTENT_BOX

MARGIN_BOX

<static> Number MARGIN_BOX

PADDING_BOX

<static> Number PADDING_BOX

Constructor Detail

Element

Element(name, parent, style, html, attrs)

Method Detail

addClass

Object addClass(<String> cl)

clear

Object clear(<Boolean> useDom)

empty

Boolean empty()

getBorder

Number getBorder(<String> side)

getBorderBox

Object getBorderBox()

getChildNodes

Array getChildNodes()

getComputedStyle

String getComputedStyle(<String> prop)

getComputedStyles

Object getComputedStyles()

getDimensions

Object getDimensions()

getElementsByClassName

Array getElementsByClassName(clsNames)

getInnerText

String getInnerText()

getNextSiblings

Array getNextSiblings()

getOpacity

Number getOpacity()

getPaddingBox

Object getPaddingBox()

getParentByTagName

Object getParentByTagName(<String> tag)

getParentNodes

Array getParentNodes()

getPosition

Object getPosition(<Number> tbt)

getPreviousSiblings

Array getPreviousSiblings()

getSiblings

Array getSiblings()

getStyle

Object getStyle(<String> prop)

getTag

String getTag()

hasAttribute

Boolean hasAttribute(<String> attr)

hasClass

Boolean hasClass(<String> cl)

hide

Object hide()

insert

Object insert(<String> ins, position, <Boolean> evalScripts)

insertAfter

Object insertAfter(ref)

isChildOf

Boolean isChildOf(<Object> anc)

isVisible

Boolean isVisible()

isWithin

Object isWithin(<Object> p1, <Object> p2)

moveTo

Object moveTo(<Number> x, <Number> y)

readAttribute

Object readAttribute(<String> attr)

recursivelyCollect

Array recursivelyCollect(<String> prop)

recursivelySum

Number recursivelySum(<String> prop)

remove

Object remove()

removeClass

Object removeClass(<String> cl)

replace

Object replace(<Object> rep, evalScripts)

resizeTo

Object resizeTo(<Number> w, <Number> h)

scrollTo

Object scrollTo()

setInnerText

Object setInnerText(<String> text)

setOpacity

Object setOpacity(<Number> op)

setParentNode

Object setParentNode(<Object> p)

setStyle

Object setStyle(<Object> prop, <Object> value)

show

Object show()

swapStyles

Object swapStyles(<Object> props, <Function> func)

toggleClass

Object toggleClass(<String> cl)

toggleDisplay

Object toggleDisplay()

update

Object update(<Object> upd, <Boolean> evalScripts, <Boolean> useDom)

writeAttribute

Object writeAttribute(<Object> attr, <Object> value)

extend

<static> void extend(<Object> props)

PHP2Go Javascript Framework

Copyright © 2002-2006 by Marcos Pont
Documentation generated by JSDoc on Sun Oct 7 19:52:10 2007