Hello,
is there any possible solution, to fadeIn(500) multiple list elements one after the other?
<ul id="list">
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
Kind Regards, Werner
Hello,
is there any possible solution, to fadeIn(500) multiple list elements one after the other?
<ul id="list">
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
Kind Regards, Werner
You could do a recursive function that stops when there's no LI left like this:
function fadeLI(elem) {
elem.fadeIn(500, function() { fadeLI($(this).next()); });
}
fadeLI($("#list li:first"));
You want a recursive function to check if there is another li element, and fade it in if so...
function fadeInNext(el){
if(el.next('li')){
el.next('li').fadeIn(500,fadeInNext)
}
}
$('...').fadeIn( 500, fadeInNext )