我在我的项目中使用了 angular-dragdrop.js lib,但我遇到了 drop 回调函数的问题。所有其他回调函数都在工作。我多次调试我的代码但找不到答案,有人遇到过这个问题吗?
这是我的html和js代码:
HTML:
<li class="li-draggable" data-drag="true"
jqyoui-draggable="{animate: true,
placeholder: 'keep',
onStart: 'startCallback',
onStop: 'stopCallback',
onDrag: 'dragCallback'}"
data-jqyoui-options="{snap: true, cursor: 'move', revert: 'invalid', helper: 'clone'}">
<a>Text <i class="icon-pencil pull-right"></i></a>
</li>
<div class="dummyCell" data-drop="true"
jqyoui-droppable="{multiple: true,
onDrop: 'dropCallback',
onOver: 'overCallback',
onOut: 'outCallback'}"
data-jqyoui-options="{hoverClass: 'hoverClass'}"></div>
JS:
$scope.startCallback = function(event, ui) {
console.log('You started draggin');
};
$scope.stopCallback = function(event, ui) {
console.log('Why did you stop draggin me?');
};
$scope.dragCallback = function(event, ui) {
console.log('hey, look I`m flying');
};
$scope.dropCallback = function(event, ui) {
console.log('hey, doneeeeeee');
};
$scope.overCallback = function(event, ui) {
console.log('Look, I`m over you');
};
$scope.outCallback = function(event, ui) {
console.log('I`m not, hehe');
};
任何帮助将不胜感激。谢谢。
更新:
删除时我在控制台中没有收到任何错误: