jQuery Draggable overflow:auto问题

时间:2012-04-25 15:45:01

标签: jquery draggable jquery-ui-draggable

如何使用overflow:auto将我的项目拖出#draggable div?示例如下。

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

1 个答案:

答案 0 :(得分:3)

使用选项:

'helper':'clone'

似乎让用户将项目拖出

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

修改,

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

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

相关问题