I have the following code to do the Drag and Drop event:
$(".device-profiles").draggable({
revert : true,
start: function(event, ui) {
dragColor = $(this).attr("data-color");
console.log("dragColor: " + $(this).attr("data-color"));
}
});
$(".mediaplayer-profiles").droppable({
drop: function (event, ui){
$(this).removeClass($(this).attr("data-color"));
$(this).attr("data-color", ui.draggable.attr("data-color"));
$(this).addClass($(this).attr("data-color"));
}
});
The first time I run the drop, it works, but when I try to change it to other places, the effect no longer works.
What could be causing this failure?