I am trying with the Selectables feature of Interface, but this seems to have some problems when you drag an elemenet that has already been dragged once for a second time. It still has position data from the previous move that causes bad things to happen. Also, it seems to be a little bit overkill for what I'm trying to do.
On Jun 6, 12:16 pm, Gordon <[EMAIL PROTECTED]> wrote: > I am writing some code using jQuery and the Interface plugin to allow > sorting of a list by drag and drop. > > The code is pretty simple and works well enough, but I could do with a > slightly more sophisticated drop behaviour. Here's the code so far: > > $(document).ready (function () > { > $('.favRow').Draggable ({ > revert : true, > ghosting : true, > autosize : true, > containment : 'parent', > opacity : 0.75, > snapDistance : 10 > }); > $('.favRow').Droppable ({ > accept : 'favRow', > tolerance : 'pointer', > hoverclass : 'dropTarget', > ondrop : function (dropped) > { > thisElem = $(this); > droppedElem = $(dropped); > > if (thisElem.attr ('id') != droppedElem.attr ('id')) > { > thisElem.before (dropped); > } > } > }); > > }); > > The result is the dragged element is always moved to before the > element it is dropped on. > > What I need is for the element to appear either before or after the > element it is dropped on depending on whether the dragged element is > dropped before or after the half way point of the element it is > dropped on. Is this possible? If so, how do I go about doing it?