Well the way I was trying to do it was proving to be too
complicated..  So I changed my html a little bit.  Now I am doing:

<div class="container">
  <div class="blah">something</div>
</div>
<div class="container">
  <div class="blah">something</div>
  <div id="me" class="blah">something</div>
  <div class="blah">something</div>
</div>
<div class="container">
  <div class="blah">something</div>
  <div class="blah">something</div>
</div>
<div class="container">
  <div class="blah">something</div>
</div>

So, from $('me') -- how can I get all of the 'div.container's that
happen after it?

I know I can do:  $('me').up('.container').next() and get the one
after it-- but my layout is dynamic and I need to be able to get all
of the containers after $('me') regardless of how many there are.

-patrick

On Oct 10, 1:26 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:
> If you use "Event" with element you can find the element that was clicked
>
> $$('.blah').each(function(e) {
>    $(e).observe('click',function(event){
>    var element=Event.element(event); // this is the element
>         var nextElements=$(element).descendants();// returns everythign that
> is a
>
>   });
>
> });
>
> This is untested. Your list is a straight list of divs so it may not work -
> but try it and see!..
>
> HTH
>
> Alex Mcauley
>
> http://www.thevacancymarket.com
>
> ----- Original Message -----
> From: "patrick" <patrick99...@gmail.com>
> To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
> Sent: Saturday, October 10, 2009 8:41 AM
> Subject: [Proto-Scripty] how to select all elements by class after a certain
>
> point?
>
> > Hi everyone,
>
> > I am a bit stuck on this..  So, I have a layout with something like
> > this:
>
> > <div class="blah">blah</div>
> > <div class="blah">blah</div>
> > <div class="other_class"></div>
> > <div class="blah">blah</div>
> > <div class="blah">blah</div>
> > <div class="blah">blah</div>
> > <div class="other_class"></div>
> > <div class="blah">blah</div>
>
> > ...  I have a function that is called when one of my '.blah' divs is
> > clicked, and so in that function  'this' refers the particular div..
> > I am trying to figure out how I can get all of the divs that are
> > '.blah' after 'this'...
>
> > Thank you.
>
> > -patrick
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to