Skip to content

Instantly share code, notes, and snippets.

@rutger1140
Created November 22, 2011 16:30
Show Gist options
  • Save rutger1140/1386093 to your computer and use it in GitHub Desktop.
Save rutger1140/1386093 to your computer and use it in GitHub Desktop.
Fade in elements with jQuery
/**
* Self-executing callback chain on an arbitrary jQuery object
*/
// Recursively fade in all products
(function shownext(jq){
jq.eq(0).fadeIn("fast", function(){
(jq=jq.slice(1)).length && shownext(jq);
});
})($('#products .product'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment