这看起来很简单,但我无法让它工作。我在 2 个不同的 droppables 中有两个 draggables。当我将一个可拖放对象从一个可拖放对象放置到另一个对象时,现有的可拖动对象应设置动画以移动到另一个可拖放区域。
$('.droppable').droppable({
hoverClass: 'hoverClass',
drop: function(event, ui) {
var $from = $(ui.draggable),
$fromParent = $from.parent(),
$to = $(this).children(),
$toParent = $to.parent();
// This is where I replace draggables' positions without animation
$toParent.html($from.css({left: '', top: '', 'z-index': ''}));
$fromParent.html($to);
makeDraggable();
}
});