I am using jquery drag and drop and I want to keep a copy of the element that I am dragging.
$('.draggable').draggable({ revert: "invalid", stack: ".draggable" //helper: 'clone' }); $('.droppable').droppable({ accept: ".draggable", drop: function( event, ui ) { var droppable = $(this); var draggable = ui.draggable; // Move draggable into droppable draggable.appendTo(droppable); draggable.css({top: '5px', left: '5px'}); } });
Jsfiddle
So, if I drag the red square into the gray window, the copy of the red square will remain in the same place, and I can drag as much as I want.
Thanks.
source share