$("div.con_user").draggable({
delay: 100,
revert: true,
containment: $(this).closest(".roomblock_content"),
start: function( event, ui) {
$(this).css("z-index", "200");
},
stop: function( event, ui) {
$(this).css("z-index","50");
}
});
JQuery UI的包含选项似乎被打破了。除非我克隆div.con_user并重新应用draggable,否则它似乎根本不尊重包含选项。
可能是因为我的页面中有很多.roomblock_content元素,或者因为我的draggable包含在droppable中?
编辑:抱歉,我忘记了HTML标记。这是:<div class="roomblock_content">
<div class="roomblock_col1">
<div class="roomblock_pool_box">
<span class="roomblock_pool_title"> Pool </span>
<ul class="roomblock_slots">
<li>
<div class="con_user prepaid_con"> </div>
</li>
<li>
<div class="con_user prepaid_con"> </div>
</li>
</ul>
</div>
</div>
</div>
答案 0 :(得分:1)