【发布时间】:2013-08-13 11:30:16
【问题描述】:
我有 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>
【问题讨论】:
-
我知道这不是 jQuery UI Draggable 但看看这个脚本pep.briangonzalez.org
-
看看这篇文章对你有没有帮助stackoverflow.com/questions/10935083/…
标签: javascript jquery html draggable jquery-ui-draggable