[jQuery] Re: How to find a parent

2009-03-01 Thread Karl Swedberg
On Mar 2, 2009, at 12:07 AM, Rick Faircloth wrote: Only up the DOM, huh? Yes, that's right. http://docs.jquery.com/Traversing/closest#expr It's a convenience method for those who want to roll their own event delegation rather than use .live() --Karl Karl Swedberg www

[jQuery] Re: How to find a parent

2009-03-01 Thread Rick Faircloth
Only up the DOM, huh? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of mkmanning Sent: Sunday, March 01, 2009 9:45 PM To: jQuery (English) Subject: [jQuery] Re: How to find a parent It checks the current element for a match, and then

[jQuery] Re: How to find a parent

2009-03-01 Thread mkmanning
> Sent: Sunday, March 01, 2009 8:23 PM > To: jQuery (English) > Subject: [jQuery] Re: How to find a parent > > It's probably worth mentioning that jQuery 1.3 also has a new 'closest' > method that would achieve this: > > $('#cancel').closest('

[jQuery] Re: How to find a parent

2009-03-01 Thread Rick Faircloth
] On Behalf Of mkmanning Sent: Sunday, March 01, 2009 8:23 PM To: jQuery (English) Subject: [jQuery] Re: How to find a parent It's probably worth mentioning that jQuery 1.3 also has a new 'closest' method that would achieve this: $('#cancel').closest('div.pop

[jQuery] Re: How to find a parent

2009-03-01 Thread Rick Faircloth
Definitely worth mentioning... very handy... -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of mkmanning Sent: Sunday, March 01, 2009 8:23 PM To: jQuery (English) Subject: [jQuery] Re: How to find a parent It's probably

[jQuery] Re: How to find a parent

2009-03-01 Thread mkmanning
Rick > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of riotbrrd > Sent: Sunday, March 01, 2009 12:58 AM > To: jQuery (English) > Subject: [jQuery] Re: How to find a parent > > You guys rock! thanks. > >

[jQuery] Re: How to find a parent

2009-03-01 Thread Rick Faircloth
Glad we could help! I was close anyway! :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of riotbrrd Sent: Sunday, March 01, 2009 12:58 AM To: jQuery (English) Subject: [jQuery] Re: How to find a parent You guys rock! thanks

[jQuery] Re: How to find a parent

2009-03-01 Thread Rick Faircloth
should be "parents" which would return more > > than the first parent. > > > Am I misunderstanding something? > > > Rick > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] > > On > > &g

[jQuery] Re: How to find a parent

2009-02-28 Thread mkmanning
> > would return more than the first parent. > > > Am I misunderstanding something? > > > Rick > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > > Behalf Of Rick Faircloth > >

[jQuery] Re: How to find a parent

2009-02-28 Thread mkmanning
erstanding something? > > Rick > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Rick Faircloth > Sent: Sunday, March 01, 2009 12:26 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: How to f

[jQuery] Re: How to find a parent

2009-02-28 Thread riotbrrd
day, March 01, 2009 12:26 AM > To: jquery-en@googlegroups.com > Subject: [jQuery] Re: How to find a parent > > Thanks for the tip! > > Rick > > -Original Message- > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > Behalf Of mkmanning >

[jQuery] Re: How to find a parent

2009-02-28 Thread Rick Faircloth
omething? Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Rick Faircloth Sent: Sunday, March 01, 2009 12:26 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: How to find a parent Thanks for the tip! Rick -Origina

[jQuery] Re: How to find a parent

2009-02-28 Thread Rick Faircloth
Thanks for the tip! Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of mkmanning Sent: Sunday, March 01, 2009 12:18 AM To: jQuery (English) Subject: [jQuery] Re: How to find a parent It should be .parents $(this).parents

[jQuery] Re: How to find a parent

2009-02-28 Thread mkmanning
It should be .parents $(this).parents('div.popup:first') On Feb 28, 9:05 pm, "Rick Faircloth" wrote: > Assuming that the cancel link has an id of 'cancel': > > How about: > > $(document).ready(function() { > >      $('#cancel').click(function() { >                 $(this).parent('div.popup:fi

[jQuery] Re: How to find a parent

2009-02-28 Thread Rick Faircloth
Assuming that the cancel link has an id of 'cancel': How about: $(document).ready(function() { $('#cancel').click(function() { $(this).parent('div.popup:first') }); }); Not sure what you want to do with the parent div when you locate it... untested, buy may work...

[jQuery] Re: How to find a parent

2009-02-28 Thread mkmanning
$(this).parents('div.popup') On Feb 28, 8:47 pm, riotbrrd wrote: > I have a bunch of Divs with class ".popup". Each div is different in > what it contains; some are simple, some are pretty complex, containing > tables, other divs, etc.. > > If I have a link, for example,"Cancel", within that Div