$(function(){
$(".item").draggable({
revert:"invalid",
revertDuration:"900",
appendTo:'droppable-container'
});
$(".droppable-container").droppable({
drop:function(event,ui){
ui.draggable.appendTo(this);
}
})
})
i just want to revert back the first dropped element after second element is dropped on droppable container,
i,e droppable container can have maximum of one item, if new item is dropped on droppable the the first dropped element must revert back to its parent.
please check the codepen link,darg and drop with revert on condition
newly added(dropped)item must remain and the previously added element must revert back to its parent. and also i want a animation effect when reverting the old/previously dropped item.
thank you...