Skip to content

Instantly share code, notes, and snippets.

@chrisforrette
Created March 14, 2012 20:55
Show Gist options
  • Save chrisforrette/2039455 to your computer and use it in GitHub Desktop.
Save chrisforrette/2039455 to your computer and use it in GitHub Desktop.
var fade = function() {
console.log('fade in');
return box.fadeIn(1500);
};
var width = function() {
console.log('width');
return box.animate({'width': 500}, 1000);
};
dfr = $.Deferred();
var chain = dfr.promise();
chain = chain
.pipe(fade)
.done(function() { console.log('this gets called after fade'); });
chain = chain.pipe(width)
chain = chain.done(function() { console.log('finished');});
dfr.resolve();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment