Created
December 18, 2009 17:20
-
-
Save jakearchibald/259626 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
@name glow.NodeList#filter | |
@function | |
@description Filter the NodeList | |
@param {Function|string} test Filter test | |
If a string is provided, it is used in a call to {@link glow.NodeList#is NodeList#is}. | |
If a function is provided it will be passed a single argument | |
representing the index of the current item in the NodeList. | |
Inside the function 'this' refers to the Node. | |
Return true in the callback include the node in the new NodeList. | |
@returns {glow.NodeList} A new NodeList containing the filtered nodes | |
@example | |
// return images with a width greater than 320 | |
glow('img').filter(function(i, nodeList) { | |
return glow(this).width() > 320; | |
}); | |
@example | |
// Get items that don't have an alt attribute | |
myNodeList.filter(':not([alt])'); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment