I have something like the following code
for(i=0, j=10; i<j ; i++){
$('#an-element-'+i).fadeIn();
}
How do I make it so that each iteration in the loop will only start once the fadeIn(); animation has completed?
edit—sorry my bad I had not included the ‘i’ in the loop
forloops are synchronous, but animations are asynchronous. You’ll need to use recursion.http://jsfiddle.net/uq9mH/