我正在尝试跨多个 CSS3 列进行拖放。我遇到的问题是可拖动的位于它旁边的列后面。如果我不使用 CSS3 列,那么它可以正常工作。
请参阅此 Codepen。
HTML:
<div class='row-fluid recurring-items'>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Baking
</h4>
<ul class='unstyled recurring-aisle' id="aisle-11">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
All Purpose Flour
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Sugar
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Brown Sugar
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Bread & baked goods
</h4>
<ul class='unstyled recurring-aisle' id="aisle-6">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Whole Wheat Bread
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Canned goods
</h4>
<ul class='unstyled recurring-aisle' id="aisle-9">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Cereal
</h4>
<ul class='unstyled recurring-aisle' id="aisle-10">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Condiments & sauces
</h4>
<ul class='unstyled recurring-aisle' id="aisle-14">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Dijon Mustard
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Dairy
</h4>
<ul class='unstyled recurring-aisle' id="aisle-3">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Milk
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Deli
</h4>
<ul class='unstyled recurring-aisle' id="aisle-7">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
Turkey Slices
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Drinks & snacks
</h4>
<ul class='unstyled recurring-aisle' id="aisle-12">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Dry packaged goods
</h4>
<ul class='unstyled recurring-aisle' id="aisle-15">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Frozen
</h4>
<ul class='unstyled recurring-aisle' id="aisle-1">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Meat/poultry
</h4>
<ul class='unstyled recurring-aisle' id="aisle-4">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Misc
</h4>
<ul class='unstyled recurring-aisle' id="aisle-8">
<li class='recurring-item'>
<!-- <i class='icon-reorder handle has-tooltip' title="drag to another aisle"></i> -->
<span class='handle'>H</span>
cream
<!-- <i class='icon-remove-circle has-tooltip' title='Remove item' data-remove-url></i> -->
</li>
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Produce
</h4>
<ul class='unstyled recurring-aisle' id="aisle-2">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Seafood
</h4>
<ul class='unstyled recurring-aisle' id="aisle-5">
</ul>
</div>
<div class='recurring-items-aisle'>
<h4 class='recurring-items-header'>
Spices
</h4>
<ul class='unstyled recurring-aisle' id="aisle-13">
</ul>
</div>
</div>
SCSS:
@import "compass/css3";
@import "compass/css3";
.planning-prefs{
margin-left: 20px;
}
@media all and (min-width: 300px) {
.recurring-items{
@include column-count(2);
@include column-gap(20px);
}
}
@media all and (max-width: 975px) and (min-width: 600px) {
.recurring-items{
@include column-count(3);
@include column-gap(20px);
}
}
@media all and (min-width: 975px) {
.recurring-items{
@include column-count(5);
@include column-gap(20px);
}
}
.recurring-items-header{
font-weight: bold;
text-decoration: underline;
}
.recurring-items-aisle{
display: inline-block;
width: 100%;
}
.recurring-item{
width: 95%;
.handle{
cursor: pointer;
}
}
咖啡脚本:
jQuery ->
$('li.recurring-item').draggable
handle: '.handle'
revert: true
appendTo: 'body'
$('ul.recurring-aisle').droppable
drop: ->
alert('dropped')
任何帮助将不胜感激。