[jQuery] Re: Find reverse? Parent?

2009-08-31 Thread #micah
maybe $(this).prev(.picture).append( On Aug 31, 2:36 pm, Jottae smallj...@gmail.com wrote: Hi guys. I am wanting to click the link with the class test the function append href taking the (already up and running) appears in the picture div, but only in the same div lol where there is

[jQuery] Re: Find reverse? Parent?

2009-08-31 Thread donb
In this case the DIV is a sibling, not a parent, of the A. So you want to select on that. If the HTML is complete as you show it, the selector needed is simply the .prev() of your A On Aug 31, 2:36 pm, Jottae smallj...@gmail.com wrote: Hi guys. I am wanting to click the link with the class

[jQuery] Re: find reverse

2009-05-27 Thread Caires Vinicius
Do you want to use parent? $(#findme).parent() http://docs.jquery.com/Traversing/parent#expr On Wed, May 27, 2009 at 9:19 AM, Peter Marino marino.pe...@gmail.comwrote: Hi jQuery Group, is it possible find a node backwards instead of forwards. i.e. div id=test0 div id=findme / div

[jQuery] Re: find reverse

2009-05-27 Thread Peter Marino
Hi Caires, something like that but it should continue up the parent until it finds it or return null peter On Wed, May 27, 2009 at 2:21 PM, Caires Vinicius caire...@gmail.com wrote: Do you want to use parent? $(#findme).parent() http://docs.jquery.com/Traversing/parent#expr On Wed, May

[jQuery] Re: find reverse

2009-05-27 Thread Andy Matthews
One thing to remember Peter is that jQuery returns an array. You could do a more comprehensive search, then reverse the returned value. Something like this might work: var $myDivs = $('div').reverse; then search through $myDivs for your preferred value. andy _ From:

[jQuery] Re: find reverse

2009-05-27 Thread M.M.
On May 27, 2:19 pm, Peter Marino marino.pe...@gmail.com wrote: Hi jQuery Group, is it possible find a node backwards instead of forwards. isn't that parents()? (not parent, parents :) http://docs.jquery.com/Traversing/parents

[jQuery] Re: find reverse

2009-05-27 Thread Peter Marino
hi, did not see the parents() method before now.. it does look this is what I need.. will check when I get home from work... thanks peter On Wed, May 27, 2009 at 4:49 PM, M.M. mario.maru...@gmail.com wrote: On May 27, 2:19 pm, Peter Marino marino.pe...@gmail.com wrote: Hi jQuery Group, is

[jQuery] Re: find reverse

2009-05-27 Thread dabear
The closest()-method (available since jquery 1.3) would be ideal here, as it stops searching when an element matching the expression is found. See also: http://docs.jquery.com/Traversing/closest Please also note that ids are unique within a document, so just $ (#test0) should be fast enough. On

[jQuery] Re: find reverse

2009-05-27 Thread Ricardo
Be aware that closest() returns the element itself if no match is found. I prefer to use $(el).parents('xx:first') to avoid that. Peter, no jQuery method will return null. If nothing is found it will return an empty collection (length == 0). On May 27, 2:03 pm, dabear bjorni...@gmail.com wrote: