0
$("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並重新應用可拖動,否則它根本不尊重遏制選項。JQuery UI Draggable遏制不適用
難道這是由於我的頁面中有很多.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>