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
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
> 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('
] 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
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
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.
>
>
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
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
> > 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
> >
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
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
>
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
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
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
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...
$(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
16 matches
Mail list logo