Hello, I have a big problem with drag and drop items in divs that have scrollbars. See http://www.wagener.nu/drag for an example. If the right scrollbar is on the top everything is fine. But if you scroll down and drag and drop then the drop-divs don''t match the cursor position. Any change to "repair" this? Hope you understand my english ;-) Best regards Tobias --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
1. It might be easier to use Sortable.create rather than trying to create the drag/drop manually. http://wiki.script.aculo.us/scriptaculous/show/Sortable.create 2. The property you''re looking for is "scroll", the value of the property should be the scrollable parent element. If you insist on not using the sortable, it should go in the options hash for the Draggable. (It''s not documented there, but the code checks for it. See the Sortable.create page linked above for more information.) TAG On Jun 15, 2007, at 8:01 AM, irata wrote:> > Hello, > > I have a big problem with drag and drop items in divs that have > scrollbars. > > See http://www.wagener.nu/drag for an example. > > If the right scrollbar is on the top everything is fine. But if you > scroll down > and drag and drop then the drop-divs don''t match the cursor position. > Any change to "repair" this? > > Hope you understand my english ;-) > > Best regards > > Tobias > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Dear TAG, thanks a log. That was the answer to my question!!! For everyone with the same problem, a short summary ;-) Before defining any Draggable you must insert this Position.includeScrollOffsets = true; in your script. And then define your Draggable with new Draggable( element, { ..., scroll: $(''<dropDiv>'') } ); But don''t ask me, if you have more than one "dropDiv" ;-) Regards, Tobias --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Your post demonstrates confusion on another issue: The id attribute of HTML elements *must* be unique to the page. It''s part of the definition of the id attribute. http://www.w3.org/TR/html401/struct/global.html#h-7.5.2 The $() function accepts a) an element id, or b) a reference to the element itself. All Prototype/Scriptaculous functions call $() internally, so anytime you pass an element reference, you may pass either the id or a reference--it''s not necessary to wrap it in $() first. TAG On Jun 15, 2007, at 9:05 AM, irata wrote:> > Dear TAG, > > thanks a log. That was the answer to my question!!! > > For everyone with the same problem, a short summary ;-) > > Before defining any Draggable you must insert this > > Position.includeScrollOffsets = true; > > in your script. > > And then define your Draggable with > > new Draggable( element, { ..., scroll: $(''<dropDiv>'') } ); > > But don''t ask me, if you have more than one "dropDiv" ;-) > > > Regards, > > Tobias > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---