[jQuery] Re: nested each - how to access parent's this??

2009-02-27 Thread Stephan Veigl
Hi, simply use a local variable: return this.each(function() { var parent = $(this); $(selector).each(function() { // do whatever you want with 'parent' }); }); by(e) Stephan 2009/2/26 mahakala : > > Hi all, > I'm new to jQuery and just got stuck on a problem where I'm having

[jQuery] Re: nested each

2009-02-26 Thread James
return this.each(function() { var parent = $(this); $(selector).each(function() { // use 'parent' here }); }); On Feb 26, 12:38 pm, mahakala wrote: > Hi all, > Is there a way to get reference to parent's this in nested each method > > return this.each(function() { > >    $(select

[jQuery] Re: nested .each issue

2008-08-18 Thread Michael Geary
Thanks for the report, Pete. It sounds like my suspicion was correct - jQuery applies the :gt() to the *entire* result set at that point, instead of the immediately preceding selector. Iin other words, this selector: .itemList .item:gt(9) is interpreted as (using double parens to indicate g