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 dra开发者_StackOverflowggable 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");
},
...
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!
精彩评论