Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Animation chain using jQuery
// `then` isn't chainable, so we use `pipe`, which also accepts a 2nd callback for failure filters
$.Deferred(function(dfr) {
.pipe(function() { $('.first').fadeIn() })
.pipe(function() { $('.second').fadeIn() })
.pipe(function() { $('.third').fadeIn() })
// Then function inside the function inside the function inside the...
$(".first").fadeIn(function() {
$(".second").fadeIn(function() {
// IMHO, we should get rid of anon functions and use the jQuery effect functions as top level objects.
$.pipe($('.first').fadeIn, $('.second').fadeIn, $('.third').fadeIn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment