在以下代码(小提琴)中:
<div class="connected">
<div class="myDivs">Hello 01</div>
<div class="myDivs">Hello 02</div>
<div class="myDivs excludeThisCss">Hello 03</div>
<div class="myDivs">Hello 04</div>
<div class="myDivs">Hello 05</div>
<div class="myDivs excludeThisCss">Hello 06</div>
<div class="myDivs">Hello 07</div>
<div class="myDivs">Hello 08</div>
<div class="myDivs excludeThisCss">Hello 09</div>
<div class="myDivs">Hello 10</div>
</div>
<div class="connected">
<div class="myDivs">Hello 01</div>
<div class="myDivs">Hello 02</div>
<div class="myDivs excludeThisCss">Hello 03</div>
<div class="myDivs">Hello 04</div>
<div class="myDivs">Hello 05</div>
<div class="myDivs excludeThisCss">Hello 06</div>
<div class="myDivs">Hello 07</div>
<div class="myDivs">Hello 08</div>
<div class="myDivs excludeThisCss">Hello 09</div>
<div class="myDivs">Hello 10</div>
</div>
JS:
$(function() {
$( ".connected" ).sortable({
connectWith : ".connected",
items : ".myDivs:not(.excludeThisCss)"
}).disableSelection();
});
CSS:
.connected {
float: left;
margin: 6px;
}
.myDivs {
margin: 0 5px 5px 5px;
padding: 5px;
font-size: 1.2em;
font-family: sans-serif;
width: 120px;
background: #F2F2F2;
cursor: pointer;
border: 1px solid #D9D9D9;
color: #1C94C4;
}
.excludeThisCss {
background: pink;
}
我正在尝试在拖放项目时执行代码。将可拖动对象放在可排序对象上时是否会触发事件?