I\'m trying to write a jquery function that loops through an unordered list (the ul element having the id \"intro\") and individually fades in and fades out each element. This
Most of these look like good solutions. I may be reading into your question, but I'm assuming the advantage of fading each in & out individually is so you can stagger the transitions.
If that's the case, I'd recommend using jQuery's .delay() method:
https://api.jquery.com/delay/
I've forked the jsfiddle @arun made to show you how it could be done:
http://jsfiddle.net/Lgwm8/1/
function startAnimations() {
var list = $("#intro li");
list.hide();
list.each(function (i, li) {
$(li).delay(i * 500).fadeIn(3000, function () {
$(li).fadeOut(3000);
});
});
}
startAnimations();