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
You can use:
function fadeLi(elem) { elem.delay().fadeIn().delay(1500).fadeOut(500, function () { if (elem.next().length > 0) { fadeLi(elem.next()); } else { fadeLi(elem.siblings(':first')); } }); } $(function () { $('#intro li').hide(); fadeLi($('ul li:first')); });
Fiddle Demo