Show:

Augments the YUI3 NodeList with more util methods.

Checks the list of Methods available for AUI NodeList.

Constructor

Methods

ancestorsByClassName

(
  • className
  • testSelf
)
NodeList

<p>Returns the current ancestors of the node element filtered by a className. This is an optimized method for finding ancestors by a specific CSS class name.</p> <p>Example:</p> <pre><code>A.one('#nodeId').ancestorsByClassName('aui-hide'); </code></pre>

Parameters:

  • className String

    <p>A selector to filter the ancestor elements against.</p>

  • testSelf Boolean

    <p>optional Whether or not to include the element in the scan</p>

Returns:

attr

(
  • name
  • value
)
String

<p>Gets or sets the value of an attribute for the first element in the set of matched elements. If only the <code>name</code> is passed it works as a getter.</p> <p>Example:</p> <pre><code>var node = A.one('#nodeId'); node.attr('title', 'Setting a new title attribute'); // Alert the value of the title attribute: 'Setting a new title attribute' alert( node.attr('title') ); </code></pre>

Parameters:

  • name String

    <p>The name of the attribute</p>

  • value String

    <p>The value of the attribute to be set. Optional.</p>

Returns:

String:

center

(
  • val
)
chainable

<p>Centralizes the current Node instance with the passed <code>val</code> Array, Node, String, or Region, if not specified, the body will be used.</p> <p>Example:</p> <pre><code>var node = A.one('#nodeId'); // Center the node with the #container. node.center('#container'); </code></pre>

Parameters:

  • val Array | Node | Region | String

    <p>Array, Node, String, or Region to center with.</p>

clone

() Node

<p>Normalizes the behavior of cloning a node, which by default should not clone the events that are attached to it.</p> <p>Example:</p> <pre><code>var node = A.one('#nodeId'); node.clone().appendTo('body'); </code></pre>

Returns:

Node:

empty

() chainable

Inherited from Node but overwritten in alloy-ui/src/aui-node/js/aui-node-base.js:326

<p>Removes not only child (and other descendant) elements, but also any text within the set of matched elements. This is because, according to the DOM specification, any string of text within an element is considered a child node of that element.</p> <p>Example:</p> <pre><code>var node = A.one('#nodeId'); node.empty(); </code></pre>

first

() Node

Returns the first element in the node list collection.

Returns:

Node:

getBody

()

Gets the body node. Shortcut to A.one('body').

getBorderWidth

(
  • sides
)
Number

<p>Returns the combined width of the border for the specified sides.</p>

Parameters:

  • sides String

    <p>Can be t, r, b, l or any combination of those to represent the top, right, bottom, or left sides.</p>

Returns:

getDoc

()

Gets the document node. Shortcut to A.one(document).

getDOM

()

getWin

()

Gets the window node. Shortcut to A.one(window).

hideAccessible

()

<p>Hides the node, while still keeping it accessible by screen readers.</p>

last

() Node

Returns the last element in the node list collection.

Returns:

Node:

showAccessible

()

<p>Shows the node. Fires after the node-base <code>show</code> method to clean up nodes which were hidden through the <code>hideAccessible</code> method.</p>

toggleAccessible

(
  • force
)

<p>Toggles the node visibility, while still keeping it accessible by screen<br> readers.</p>

Parameters:

  • force Boolean

    <p>If true the node will be shown, otherwise it will be hidden.</p>