我正在对拖动开始做一些更改,并希望在drop失败时还原它们.我在dragend触发的函数中编写了这个逻辑.这完美的作品在Chrome浏览器,但火狐 "Dragend"事件不被解雇.
谁能告诉我一些关于这种行为的事情?我在ubantu上使用firefox 22.0.
代码如下
$(".view-controller").on("dragover", that.dragOverMain);
$(".view-controller").on("dragenter", that.dragEnterMain);
$(".view-controller").on("dragexit dragleave", that.dragExitMain);
$(".view-controller").on("dragend", that.dragEndMain);
$(".view-controller").on("drop", that.dropMain);
$(".view-controller").children().on("dragstart", function(e) {
that.dragStartChild(e);
});
$(".view-controller").children().on("dragend", function(e) {
that.dragEndMain(e);
});
dragStartChild: function(e) { console.log('dragStartChild'); },
dragEndMain: function(e) { console.log('dragEndMain'); e.preventDefault(); },
dropMain: function(e) { console.log('dropMain'); e.preventDefault(); },
dragExitMain: function(e) { console.log('dragExitMain'); e.preventDefault(); },
dragEnterMain: function(e) { console.log('dragEnterMain'); e.preventDefault(); },
dragOverMain: function(e) { console.log('dragOverMain'); e.preventDefault(); },
Run Code Online (Sandbox Code Playgroud)