Created
March 14, 2012 20:55
-
-
Save chrisforrette/2039455 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
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