I am trying the following:
Stage 1:
- Change the draggable element from li to div on drop in #canvas
- Move the draggable element inside #canvas
Stage 2:
- Change the draggable element from div to li on drop in #imagelist
- Move the draggable element inside #imagelist
Js:
$(function () {
var $imagelist = $("#imagelist");
var $canvas = $("#canvas");
$('li', $imagelist).draggable();
$canvas.droppable({
drop: function (event, ui) {}
});
$imagelist.droppable({
drop: function (event, ui) {}
});
});
Html:
<div id="listwrapper">
<ul id="imagelist">
<li class="draggable>Content that should not be lost on drag/drop</li>
<li class=" draggable>Content that should not be lost on drag/drop</li>
</ul>
</div>
<div id="canvas">
<div class="draggable">Content that should not be lost on drag/drop</div>
</div>
Could someone help me with this?