我有 3 个块( div )。当在这些块中单击时,div 被选中并且它对类可见。
我需要禁用元素的 draggable(),因为即使在拖动功能中也停止。 JS:
$('#llens').on("click", "#mou", function (event) {
$(this).parents(':eq(2)').draggable({
disabled: false,
containment: "parent",
scroll: false,
cursor: "move",
delay: 200,
start: function (e, ui) {
remember = $(this).html();
$(this).addClass('fantasma');
},
stop: function (e, ui) {
$(this).removeClass('fantasma');
// **WHEN IS STOPPED IT MAY DISABLE THE DRAG**
}
<div id="llens">
<div class="bloc professor" id="bloc_profes" style="top:40px; left:200px; width:800px; height:200px " data-actiu="true"></div>
<div class="bloc text" id="bloc_text" style="top:100px; left:200px; width:800px; height:100px " data-actiu="false"></div>
<div class="bloc alumne" id="bloc_alumnes" style="top:200px; left:200px; width:800px; height:200px " data-actiu="false"></div>
</div>
演示: http: //fiddle.jshell.net/blackersoul/47YvE/5/