jQuery可拖动溢出问题

4
1个回答

3

使用选项:

'helper':'clone'

似乎可以让用户拖动该项

http://jsfiddle.net/7rmY3/5/

编辑,

如果您需要删除拖动的项目,请在可释放方法的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();
           }
});

http://jsfiddle.net/7rmY3/14/


谢谢。helper:clone 确实拖出了该项,但该项仍留在 #draggable 中,应在拖出时被删除。 - steamboy
好的,你可以在插件事件中手动完成它,查看我的编辑。 - Toni Michel Caubet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接