如何使可拖动元素适合 div 而不会相互折叠

How to make draggable elements fit to div and not collapse on each other

因此,每次我将元素拖放到 div 时,都会发生两个问题。 1. 不适合div。 2. 当我拖放一个元素时它会崩溃,所以我需要一种方法来保持 space 用来完整使用的元素。

https://jsfiddle.net/1yy2u8qw/

$( ".selector" ).droppable({ tolerance: "fit" }); //is this correct?

看起来你错过了 <table>.dropheight:90px - 所以拖入元素会溢出它。更改为 min-height:90px

这是解决方案

https://jsfiddle.net/1nrouva3/2/