[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread MorningZ
oops.. too late with my reply... your selector and my "find then filter" are doing the same thing. the key point you figured out is "in each group", which means you had to start at "div.location" and loop through those

[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread MorningZ
there *more than likely* is a quicker all in one selector to do this, but this http://jsbin.com/ijana/edit works as you asked plus might be easier to follow :-) On Dec 14, 2:28 pm, wandrian wrote: > Hey folks. > > I am having a selector issue. Wondering if anyone might want to offer > their ad

[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread wandrian
You can see it in action at: http://jsbin.com/uzezi3/edit

[jQuery] Re: Trying to select the first visible child in each group.

2009-12-14 Thread wandrian
So this works: $('.location').each(function(){ $('div.trip:visible:first', this).addClass('first'); }); but it seems a little verbose. Is there a way of making it more efficient?