1$('.draggable').draggable({
2 revert: "invalid",
3 stack: ".draggable",
4 helper: 'clone'
5});
6$('.droppable').droppable({
7 accept: ".draggable",
8 drop: function(event, ui) {
9 var droppable = $(this);
10 var draggable = ui.draggable;
11 // Move draggable into droppable
12 var drag = $('.droppable').has(ui.draggable).length ? draggable : draggable.clone().draggable({
13 revert: "invalid",
14 stack: ".draggable",
15 helper: 'clone'
16 });
17 drag.appendTo(droppable);
18 draggable.css({
19 float: 'left'
20 });
21 }
22});