Element provides an interface to an HTMLElement's attributes and common
methods. Other commonly used attributes are added as well.
@uses YAHOO.util.AttributeProvider
|
Element(el {HTMLElement , Object map ) |
Element |
|
|
addClass(String className ) : void |
Element |
Wrapper for Dom method. |
|
addListener(String type , Function fn , Any obj , Object scope ) : void |
Element |
Adds a listener for the given event. These may be DOM or
customEvent listeners. Any event that is fired via fireEve... |
|
appendChild(Boolean deep ) : void |
Element |
Wrapper for HTMLElement method. |
|
appendTo(HTMLElement | , HTMLElement | ) : void |
Element |
Appends the HTMLElement into either the supplied parentNode. |
|
fireQueue() : void |
Element |
Apply any queued set calls. |
|
getElementsByClassName(String className , [String tag ]) : Array |
Element |
Wrapper for Dom method. |
|
getElementsByTagName(String tag ) : void |
Element |
Wrapper for HTMLElement method. |
|
getStyle(String property ) : String |
Element |
Wrapper for Dom method. |
|
hasChildNodes() : Boolean |
Element |
Wrapper for HTMLElement method. |
|
hasClass(String className ) : Boolean |
Element |
Wrapper for Dom method. |
|
initAttributes(Object map ) : void |
Element |
Registers Element specific attributes. |
|
insertBefore(HTMLElement element , HTMLElement before ) : void |
Element |
Wrapper for HTMLElement method. |
|
on(String type , Function fn , Any obj , Object scope ) : void |
Element |
Alias for addListener |
|
removeChild(HTMLElement child ) : void |
Element |
Wrapper for HTMLElement method. |
|
removeClass(String className ) : void |
Element |
Wrapper for Dom method. |
|
removeListener(String type , Function fn ) : void |
Element |
Remove an event listener |
|
replaceChild(HTMLElement newNode , HTMLElement oldNode ) : void |
Element |
Wrapper for HTMLElement method. |
|
replaceClass(String oldClassName , String newClassName ) : void |
Element |
Wrapper for Dom method. |
|
setStyle(String property , String value ) : void |
Element |
Wrapper for Dom method. |
addClass
public function addClass(String className
)
Wrapper for Dom method.
Parameters:
className
: StringThe className to add
Returns:
This method is defined by Element.
addListener
public function addListener(String type
, Function fn
, Any obj
, Object scope
)
Adds a listener for the given event. These may be DOM or
customEvent listeners. Any event that is fired via fireEvent
can be listened for. All handlers receive an event object.
Parameters:
type
: StringThe name of the event to listen for
fn
: FunctionThe handler to call when the event fires
obj
: AnyA variable to pass to the handler
scope
: ObjectThe object to use for the scope of the handler
Returns:
This method is defined by Element.
appendChild
public function appendChild(Boolean deep
)
Wrapper for HTMLElement method.
This method is defined by Element.
appendTo
public function appendTo(HTMLElement |
, HTMLElement |
)
Appends the HTMLElement into either the supplied parentNode.
This method is defined by Element.
fireQueue
public function fireQueue()
Apply any queued set calls.
This method is defined by Element.
getElementsByClassName
public function getElementsByClassName(String className
, [String tag
])
Wrapper for Dom method.
Parameters:
Returns:
Array
Array of HTMLElements
This method is defined by Element.
getElementsByTagName
public function getElementsByTagName(String tag
)
Wrapper for HTMLElement method.
Parameters:
tag
: StringThe tagName to collect
Returns:
This method is defined by Element.
getStyle
public function getStyle(String property
)
This method is defined by Element.
hasChildNodes
public function hasChildNodes()
Wrapper for HTMLElement method.
This method is defined by Element.
hasClass
public function hasClass(String className
)
Wrapper for Dom method.
Parameters:
className
: StringThe className to add
Returns:
This method is defined by Element.
initAttributes
public function initAttributes(Object map
)
Registers Element specific attributes.
This method is defined by Element.
insertBefore
public function insertBefore(HTMLElement element
, HTMLElement before
)
Wrapper for HTMLElement method.
This method is defined by Element.
on
public function on(String type
, Function fn
, Any obj
, Object scope
)
Alias for addListener
Parameters:
type
: StringThe name of the event to listen for
fn
: FunctionThe function call when the event fires
obj
: AnyA variable to pass to the handler
scope
: ObjectThe object to use for the scope of the handler
Returns:
This method is defined by Element.
removeChild
public function removeChild(HTMLElement child
)
Wrapper for HTMLElement method.
This method is defined by Element.
removeClass
public function removeClass(String className
)
Wrapper for Dom method.
Parameters:
className
: StringThe className to remove
Returns:
This method is defined by Element.
removeListener
public function removeListener(String type
, Function fn
)
This method is defined by Element.
replaceChild
public function replaceChild(HTMLElement newNode
, HTMLElement oldNode
)
Wrapper for HTMLElement method.
This method is defined by Element.
replaceClass
public function replaceClass(String oldClassName
, String newClassName
)
Wrapper for Dom method.
Parameters:
oldClassName
: StringThe className to replace
newClassName
: StringThe className to add
Returns:
This method is defined by Element.
setStyle
public function setStyle(String property
, String value
)
This method is defined by Element.