Class Element
Defined in: Element.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Element ()
Extensions to the DOM Core
Element interface. |
Method Attributes | Method Name and Description |
---|---|
addClassName (className)
Adds the given class name to the element's
class attribute if it's not already there. |
|
applyTransition (transitionDefinition, reversed)
Applies a transition definition to the element, allowing the transition to be reversed.
|
|
hasChild (child)
Returns true if the element has the given child node
FIXME: should this be on Node?
|
|
hasClassName (className)
Indicates whether the element has a given class name within its
class attribute. |
|
Removes all the children from an element.
|
|
removeClassName (className)
Removes the given class name from the element's
class attribute if it's there. |
|
toggleClassName (className)
Adds the given class name to the element's
class attribute if it's not there, or removes it if it's already set. |
Method Detail
addClassName(className)
Adds the given class name to the element's
class
attribute if it's not already there.
- Parameters:
- {String} className
- The CSS class name.
applyTransition(transitionDefinition, reversed)
Applies a transition definition to the element, allowing the transition to be reversed. If this method is called
within a
TKTransaction
, the transition will only be commited when the transaction is completed.
- Parameters:
-
{
TKTransitionDefinition
} transitionDefinition - The transition applied to the element.
- {bool} reversed
- Indicates whether the transition is to be applied in reverse.
hasChild(child)
Returns true if the element has the given child node
FIXME: should this be on Node?
- Parameters:
-
{
Element
} child - The child to search for
{bool}
hasClassName(className)
Indicates whether the element has a given class name within its
class
attribute.
- Parameters:
- {String} className
- The CSS class name.
- Returns:
- {bool} Whether the element has this class name within its
class
attribute.
removeAllChildren()
Removes all the children from an element.
removeClassName(className)
Removes the given class name from the element's
class
attribute if it's there.
- Parameters:
- {String} className
- The CSS class name.
toggleClassName(className)
Adds the given class name to the element's
class
attribute if it's not there, or removes it if it's already set.
- Parameters:
- {String} className
- The CSS class name.