如何使用溢出:自动将我的项目拖出#draggable div?下面的例子。
问问题
1836 次
1 回答
3
使用选项:
'helper':'clone'
似乎让用户将项目拖出
编辑,
如果您需要删除拖动的项目,请在 droppable 方法的 drop 事件中进行。我应用了索引 id 来识别项目,但这可以通过不同的方式进行
$('#target').droppable({
drop: function(event,ui){
// Append the item in the droppable div
$(this).append($(ui.draggable));
// Remove the item from the draggable list
$('#draggable li#'+$(ui.draggable).attr('id')).remove();
}
});
于 2012-04-25T16:00:58.647 回答