Created
October 5, 2012 20:33
-
-
Save c4urself/3842214 to your computer and use it in GitHub Desktop.
Recursively hide a set of matched elements
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
// Self-calling named function which takes an array of elements | |
// calls an event on the first element in that array and passes | |
// the rest of the array to that function recursively until the | |
// array is empty. The recursive call is done in the callback of | |
// the previous element's event so that it nicely waits for the | |
// previous element to be done. | |
(function hidenext(jq) { | |
jq.eq(0).fadeOut("fast", function(){ | |
(jq=jq.slice(1)).length && hidenext(jq); | |
}); | |
})($('div#bodyContent a')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment