This should do what you want, but I got rid of your code eval(). Not sure why you are taking this approach.
Example: http://jsfiddle.net/wqWE5/
I also changed the second argument from "slow"to 800so that it can be used in .delay().
The duration of the passage, multiplied by the current index .each(), will make the animation in sequence.
$(function(){
chainAnim('.section',800,'1');
});
function chainAnim(e,s,o) {
var $fade = $(e);
var code = function() {console.log('Done.');};
$fade.each(function( i ){
$(this).delay(i * s).fadeTo(s,o,code);
});
}
source
share