So, I would like an element to fade in and wait half a second, then fade the next in etc...
My code:
$(\'.comment\').each(function() {
This function will iterate through every element in the collection (in this example $comments
) and fade in all of them. Every animation will start when the previous one has finished.
var $comments=$('.comment');
(function fadeIterator($collection, index) {
$collection.eq(index).fadeIn(1000, function () {
fadeIterator($collection, index++);
});
}($comments, 0));
jsFiddle Demo