On Sep 21, 2:18 pm, Jim Higson <j...@wikizzle.org> wrote: > A bit like the parameter to Element#up, the selector would define where to > stop. Eg: > > <html> > <body> > <div class="content"> > <p> > blah > <span id="interesting-content"> > not really so interesting > </span> > </p> > </div> > </body> > </html> > > $('interesting-content').ancestors('div#content') > > returns: > > [<p>, <div#content>] > > Not: > > [<p>, <div#content>, <body>, <html>] > > Because body and hmtl usually aren't that useful anyway. > > Does this sound useful? Think of any other refinements?
It does (although not just with `ancestors` but with `recursivelyCollect`, so that `ancestors`, `nextSiblings`, `previousSiblings` and `childElements` could all take a css expression). We had this idea 2 years ago first time (http://dev.rubyonrails.org/ ticket/11143), then again a year later (https:// prototype.lighthouseapp.com/projects/8886/tickets/349-allow- elementnextsiblings-to-take-a-css-rule). I'm not sure why it never got anywhere. [...] -- kangax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@googlegroups.com To unsubscribe from this group, send email to prototype-core-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---