While being dragged they get position absolute and a left and top css. Just reset those properties with .css() - Richard
On Tue, Aug 18, 2009 at 8:46 AM, Casper <[email protected]> wrote: > > It does work, but the controls move quite a lot after being dropped > due to the .append() call. > And they also seem to mess with each others positions when moved > afterwards. > > Do you have any idea why this is? > > Thanks, > Casper > > On Aug 18, 1:59 pm, "Richard D. Worth" <[email protected]> wrote: > > It's up to you to do any modification as a result of the drop event, like > > so: > > $('#droppable').droppable({ > > drop: function(event, ui) { > > $(this).append(ui.draggable); > > } > > > > }); > > > > - Richard > > > > On Tue, Aug 18, 2009 at 7:49 AM, Casper <[email protected]> > wrote: > > > > > Hi there, > > > I'm building a userinterface for site adminitrators to defince custom > > > screens. > > > > > I have a div with possible controls all adorned with > > > class="draggable". > > > Another div with id="droppable" where the administrator can drop the > > > controls he wants the end user to see. > > > I want to find all the dragged controls and thought I could do > > > something like this: > > > $("#gathercontrols").click(function(e){ > > > e.preventDefault(); > > > var $children = $("#droppable").children(); > > > $children.each(function(i){ > > > // Do the stuff here... > > > }); > > > }); > > > where #gathercontrols is a button to save the layout. > > > But there appears to be no children after having dragged the controls > > > there. > > > Have I misunderstood how the droppable/draggable stuff works? I > > > thought the DOM would be changed so the dragged controls would appear > > > under the droppable. > > > > > Any ideas? > > > > > Thanks > > > Casper > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
