You're passing the string "i". Remember that the selector is just a string passed to the jQuery object. Try this:
$('li:eq('+i+')').fadeIn('slow'); On Thu, Jan 22, 2009 at 5:41 AM, elduderino <jamesfiltn...@gmail.com> wrote: > > > HI, > > I have this code: > > $(document).ready(function(){ > > $('li').each(function(i) { > alert(i); > $('li:eq(i)').fadeIn('slow'); > }); > > }); > > I want to iterate over each li element and fade it in....with a delay for > each one....i'll deal with the delay in a bit but currently the problem is > this bit $('li:eq(i)')....it won't accept the i parameter...it wants a > literal number....how do I do this? > > -- > View this message in context: > http://www.nabble.com/Need-access-to-index-within-loop-tp21601683s27240p21601683.html > Sent from the jQuery General Discussion mailing list archive at Nabble.com. > >