2012-04-25 42 views

回答

3

'helper':'clone'

似乎让用户dragg项目拖出

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

编辑,

如果您需要删除拖动的项目,请在droppable方法的拖放事件中执行此操作。我申请一个索引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/

+0

感谢。 helper:clone确实拖出了项目,但项目保留在#draggable中,拖出时应该将其删除 – steamboy 2012-04-25 16:33:40

+0

以及您可以在插件事件中手动执行此操作,请检查我的编辑 – 2012-04-25 16:42:38