2011-11-21 70 views
1

我有工作在jquery sortable,都工作正常。但空的div不會接受可拖動的內容。jquery sortable - 空div不會接受值

這裏我jQuery的,

$(".dropfalse").sortable({ 
      connectWith: ".dropfalse", 
      revert: true,   
      tolerance: 'pointer', 
      placeholder: "ui-state-highlight", 
      cursor: 'pointer', 
      dropOnEmpty: true, 
      forcePlaceholderSize: true 
     }); 

     $('#sortable').disableSelection(); 

任何建議。

+0

什麼?解釋更多...添加一些代碼,清楚! –

+0

壩鎮...提高你的問題 – anglimasS

+0

這裏的解決方案:http://stackoverflow.com/questions/6832687/jquery-problem-with-sortable-items-cant-be-dropped-onto-empty-lists 摘要:添加填充到容器 – Populus

回答

5

你確定目標div不是零維度,可能是高度。

+0

好的謝謝........ Nanb​​a –

1

我有一個div的問題,當它爲空時,將不會收到任何可丟棄的項目。我只是通過爲可排序div定義最小高度和最小寬度來解決這個問題,所以即使當div爲空時,您也可以將它放在可拖放或排序的相同區域。如果沒有最小尺寸,您將無法觸及div。