我正在尝试以下操作:
阶段1:
- 在#canvas中拖放时将可拖动元素从li更改为div
- 在#canvas内移动可拖动元素
第 2 阶段:
- 在#imagelist中拖放时将可拖动元素从div更改为li
- 在#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>
有人可以帮我解决这个问题吗?