Hi, I have this code....it''s using scriptaculous dragging. <span id="droppable1_2" class="space"> _______________ <div id="draggable_8" class="de_small">low-pitched</div> </span> The span is the droppable zone which is hard-coded and the div is the draggable element that has been dropped here. What i''m trying to do is detect if a droppable zone already has a draggable piece in it (This will be in a function that fires when a piece is dragged on the dropzone....if the dropzone already has a draggable peice in there it will be deleted and the new one will replace it). Problem is i can''t seem to access this draggable piece once it''s been dropped. I''ve got a reference to the span. IN the code below it''s assigned to the variable dropp. So i''m ttrying to access the draggable piece in the code above: I''ve tried: var ooo = $(dropp).next(''.de_small''); var ooo = $(dropp).next(0); var ooo = $(dropp).next(1); var ooo = $(dropp).down(0); var ooo = $(dropp).down(''de_small''); But none work.....I should be able to access the piece even though it''s been inserted in to the droppable span on the fly right??? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Element#next is for siblings, not children, so that won''t work. $(dropp).down(''.de_small'') should work (you left out the dot - your version looks for an element named <de_small>. $(dropp).down(0) seems like it should work, as should $(dropp).down() with no parameters, as long as there are no other children in that span. -Fred On Thu, Jul 3, 2008 at 7:15 AM, elduderino <jamesfiltness-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > var ooo = $(dropp).next(''.de_small''); > var ooo = $(dropp).next(0); > var ooo = $(dropp).next(1); > var ooo = $(dropp).down(0); > var ooo = $(dropp).down(''de_small''); > > But none work.....I should be able to access the piece even though > it''s been inserted in to the droppable span on the fly right???-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---