Created
August 14, 2008 14:36
-
-
Save brandonaaron/5435 to your computer and use it in GitHub Desktop.
This file contains 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
// Helper method for Prototype to loop over a collection of elements | |
// and run a method on existing elements within the dom | |
Object.extend(Array.prototype, { | |
each_element_invoke: function(method) { | |
var args = $A(arguments).slice(1); | |
return this.map(function(element) { | |
return element && element[method].apply(element, args); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment