Adam Strudwick
Adam Strudwick

Reputation: 13129

Jquery-ui drag and drop: using a draggable more than once

How can an element be dragged and drop more than once with jquery's ui, since normally the draggable element is moved when drop is triggered?

Upvotes: 0

Views: 1192

Answers (1)

David Wick
David Wick

Reputation: 7095

use jquery draggable's helper option helper: 'clone' and handle the drop event like so:

$("#droppable").droppable({
    drop: function(event, ui) {
        $(this).append($(ui.draggable).clone());
    }
});

Upvotes: 2

Related Questions