NodeList

The NodeList class provides a wrapper for manipulating DOM Node. use KISSY.all/one to retrieve NodeList instances

defined in: base.js

Class

Attributes

  • length {Number} length of nodelist

Methods

  • add (selector, context, index) Add existing node list.
  • NodeList. all (selector, context) <static> Get node list from selector or construct new node list from html string.
  • all (selector) Get node list which are descendants of current node list.
  • each (fn, context) Applies the given function to each Node in the NodeList.
  • end () return last stack node list.
  • getDOMNode () Retrieves the DOMNode.
  • getDOMNodes () Retrieves the DOMNodes.
  • item (index) Get one node at index
  • slice (start, end) Get part of node list.

Class Detail

  • NodeList ()
    The NodeList class provides a wrapper for manipulating DOM Node. use KISSY.all/one to retrieve NodeList instances

Attributes Detail

  • length {Number} length of nodelist

Methods Detail

  • add (selector, context, index) view source
    Add existing node list.
    Parameters
    •   selector {String|HTMLElement[]|NodeList} Selector string or html string or common dom node.
    • [ context ] {String|Array|NodeList|HTMLElement|Document} Search context for selector
    • [ index ] {Number} Insert position.
    Returns
  • NodeList. all (selector, context) <static> view source
    Get node list from selector or construct new node list from html string. Can also called from KISSY.all
    Parameters
    •   selector {String|HTMLElement[]|NodeList} Selector string or html string or common dom node.
    • [ context ] {String|Array|NodeList|HTMLElement|Document} Search context for selector
    Returns
  • all (selector) view source
    Get node list which are descendants of current node list.
    Parameters
    •   selector {String} Selector string
    Returns
  • each (fn, context) view source
    Applies the given function to each Node in the NodeList.
    Parameters
    •   fn The function to apply. It receives 3 arguments: the current node instance, the node's index, and the NodeList instance
    • [ context ] An optional context to apply the function with Default context is the current NodeList instance
  • end () view source
    return last stack node list.
    Returns
  • getDOMNode () view source
    Retrieves the DOMNode.
  • getDOMNodes () view source
    Retrieves the DOMNodes.
  • item (index) view source
    Get one node at index
    Parameters
    •   index {Number} Index position.
    Returns
  • slice (start, end) view source
    Get part of node list.
    Parameters
    •   start {Number} Start position.
    •   end {number} End position.
    Returns
blog comments powered by Disqus
Top