views:

26

answers:

1

I have some UI functionality for drag and drop, but when an element is dropped, the animation makes it flit about all over the place for a split second before it appears in the newly dropped location.

Can anyone advise how to tackle this, so that the draggable element moves more cleanly into place on success?

Here is a snippet from the ajax call on successful drop:

...
success : function() {
      $(ui.draggable)
        .parent()
        .droppable("enable")
        .end()
        .appendTo(droppable)
        .parent()
        .droppable("disable");
    },
...
A: 

not tested but something like this

success : function() {
      $(ui.draggable)
        .parent().hide().droppable("option", "disabled", false)
        .end()
        .appendTo(droppable).show()
        .droppable("option", "disabled", true);
    },

anyway you can also unbind the animation while the element is moving! but i don't know the rest of the code!

aSeptik