First off, I want to thank everyone for such quick replies.
> That will work, but it's a fairly brittle way to do things. If you add
> another link earlier in your page, it will change the loop indexes and
> you'll have to revise your code to match.
I understand and agree with you. I don't think
> > If you just want the loop index, it's passed to the .each() callback as the
> > first parameter:
>
> > $('a').each( function( i ){
> > // 'i' is the loop index
> > $(this).click(function(){
> > // You can use 'i' directly in this code
> > });
> > })
> > From: Michael Geary
> > But is the loop index that useful here? I'm trying to
> > picture what you might do with it. There may be a
> > better way to do this - if you could say more about
> > your application, someone may have a suggestion.
> From: SLR
> To give you a brief rundown. Imagine
day, November 30, 2008 3:12 PM
To: jQuery (English)
Subject: [jQuery] Re: jQuery loop help
> No question is too "noobie". Welcome aboard! :-)
I appreciate the warm welcome = )
> That code won't work at all.
> I would suggest reading the doc page on .each():
Definitely on my
> No question is too "noobie". Welcome aboard! :-)
I appreciate the warm welcome = )
> That code won't work at all.
> I would suggest reading the doc page on .each():
Definitely on my to-do list...
> If you just want the loop index, it's passed to the .each() callback as the
> first parameter:
> From: SLR
>
> First off, I apologize if this is too "noobie" a question or
> has been answered somewhere else (I can't find it anywhere).
> I'm new to jQuery, and I'm trying to learn some basics.
No question is too "noobie". Welcome aboard! :-)
> Anyways, I'm stumped on the following.
>
>
6 matches
Mail list logo