$("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 并重新应用可拖动对象,否则它似乎根本不尊重包含选项。
可能是因为我的页面中有许多 .roomblock_content 元素,还是因为我的可拖动对象包含在可放置对象中?
编辑:对不起,我忘记了 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>