I do not think that Deferries will be very useful here. Of course, you can get .promise() for each queue [effect] in jQuery instances, and because of this method, you can even pass jQuery objects to $.when , but I think the callback chain is also for sequential animations, which you need some chain - can make it easier:
function chainedFadeIn($el, order, callback) { if (!order.length) return callback(); $el.eq(order.shift()).fadeIn(500, function() { chainedFadeIn($el, order, callback);
Alternative version with Promises:
function getFadeInChain($el, order) { if (!order.length) return order; // or anything else return $el .eq(order.shift()) .fadeIn(500) .promise() .then(getFadeInChain.bind(null, $el, order)); } getFadeInChain($(this), [3,2,6,4,0,1,5]).done(function() { // do something });
Demo on jsfiddle.net: Callbacks, Deferred
Bergi source share