我正在使用html5 dragndrop native。每个事件都被解雇了?但不要放弃。
$(".dnd").each(function(obj) {
$(this).attr('draggable', true);
$(this).on('dragstart', function(event) {
event.stopPropagation();
console.log('dragStart ' + $(this).attr('id'));
event.originalEvent.dataTransfer.effectAllowed = 'move';
event.originalEvent.dataTransfer.setData('text/data', this,content');
});
$(this).on('drop', function(event) {
event.stopPropagation();
console.log('drop ' + $(this).attr('id'));
var data = event.dataTransfer.getData('text/data');
console.log('data: ' + data);
});
});