Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the jQuery clone() method to clone the main draggable element and then initialize the cloned version as draggable using the jQuery UI draggable() method as follows:

// Clone the main draggable element
var $clonedElement = $('#main-draggable').clone();

// Make the cloned element draggable
$clonedElement.draggable();

// Append the cloned element to the container
$('#container').append($clonedElement);

Note that you should give the cloned element a new ID or class, otherwise you'll end up with multiple elements with the same ID, which is invalid HTML.