0

我想将宽度为 60px 的 div(ccarcellbook)拖放到宽度为 20px(ccarcell)的 3 个 div 上。具有基本的 dnd 功能,以便大 div 替换小 div 之一,但不知道如何替换 3 个小 div

jQuery

$('.ccarcellbook').draggable({
  helper:"clone",
  cursor: "move",
  snap:'.ccarcell', 
  snapMode:'inner'
});
$('.ccarcell').droppable({
  over: function(event, ui) {var $this = $(this)},
  drop:function(event, ui) {
  ui.draggable.detach().appendTo($(this));
  }
});

html

<div class="ccarcell"></div>
<div class="ccarcell"></div>
<div class="ccarcell"></div>
<div class="ccarcellbook>DRAG ME</div>
<div class="ccarcell"></div>
<div class="ccarcell"></div>
<div class="ccarcell"></div>

欢迎任何建议

4

0 回答 0