Do a series of fade-in, fade-outs (but execute serially)

Do a series of fade-in, fade-outs (but execute serially)

Hi all,

Basically, I am calling a function in a for-loop. That function fades in and out some elements on the DOM. 
However, the for-loop keeps advancing up to its maximum before the animations in my function are done. 

How can I tell my for-loop to wait until the first function call is done before advancing to the next iteration?

Cheers.