如何在jQuery Pep中删除后停止拖拽

时间:2014-08-23 17:37:46

标签: javascript jquery jquery-plugins

使用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}}

由于

1 个答案:

答案 0 :(得分:1)

尝试在this.toggle()回调中添加rest

$('.pep').pep({
  droppable: '.droppable',
  rest: function(){
   if (this.activeDropRegions.length) this.toggle();
  }
});

这也是 Codepen demo