使用jquery jquery.pep.js插件,你能看一下 This Demo ,让我知道如何在放入.pep
之后阻止.drop-taget
拖动$('.demo.droppable .pep').pep({
droppable: '.drop-target',
drag: function(ev, obj){
console.log(
[ "There is ",
this.activeDropRegions.length,
" active drop region(s)." ].join('')
)
}
})
?
{{1}}
由于
答案 0 :(得分:1)
尝试在this.toggle()
回调中添加rest
:
$('.pep').pep({
droppable: '.droppable',
rest: function(){
if (this.activeDropRegions.length) this.toggle();
}
});
这也是 Codepen demo 。