[jQuery] Re: Getting prev siblings

2007-08-12 Thread DaveG
Thanks for the heads-up. I did use nextUntil, but did not know that page was there -- contains some useful info. ~ ~ Dave patcoll wrote: jQuery 1.2 looks to have a prevUntil() function planned. http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29 There's a sampl

[jQuery] Re: Getting prev siblings

2007-08-07 Thread patcoll
jQuery 1.2 looks to have a prevUntil() function planned. http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29 There's a sample for nextUntil there... copy it and change it for your needs? Pat On Aug 6, 11:44 am, DaveG <[EMAIL PROTECTED]> wrote: > On Mon, 6 Aug 2007 0

[jQuery] Re: Getting prev siblings

2007-08-06 Thread DaveG
This should work... but it is a little wasteful as it performs the same search on h2s over and over again. Another way (that I'm not sure will work) is: var h2cache = $('h2'); var prevIndex = h2cache.index( $('#h2b')[0] ) - 1; h2cache.filter(':eq('+prevIndex+')'); This is *exactly* what I

[jQuery] Re: Getting prev siblings

2007-08-06 Thread Brian Cherne
$('#h2b').prev(); returns [h3#h3b] // returns previous sibling $('#h2b').prev('h3'); returns [h3#h3b] // returns previous sibling because it is an h3 $('#h2b').prev('.foo'); returns [] // empty, because previous sibling does have class of 'foo' $('h2').prev('h3'); returns [h3#h3b] $('h2,h3

[jQuery] Re: Getting prev siblings

2007-08-06 Thread DaveG
On Mon, 6 Aug 2007 08:14:28 -0700, "Glen Lipka" <[EMAIL PROTECTED]> wrote: > It would help if you put up a skeleton page somewhere to demonstrate the > challenge. > :) Good point. Unfortunately, I can't do that right now, but here's a skeleton of the issue: Heading 2a Heading 3a Heading

[jQuery] Re: Getting prev siblings

2007-08-06 Thread Glen Lipka
It would help if you put up a skeleton page somewhere to demonstrate the challenge. :) Glen On 8/6/07, DaveG <[EMAIL PROTECTED]> wrote: > > > > Is there a way to get the previous sibling of a specific class in the DOM > (a) at the same level as the start point, and (b) at lower levels? > > .prev