/*! * jQuery seq - v0.1 - 03/1/2011 * http://benalman.com/ * * Copyright (c) 2011 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ (function($){ $.fn.seq = function( fn, done ) { var elems = this; if ( elems.length ) { fn.call( elems[0], function() { $.fn.seq.call( elems.slice(1), fn, done ); }); } else if ( done ) { done(); } return elems; }; })(jQuery);