UI droppable for a project, I would like to detect the opposite to the accepted event.
I mean that if i drag and drop a not accepted container do some action, so far I haven't found any way to detect it.
Found out that using the revert
option for the draggable event can solve it.
$("selector").draggable({
revert : function(droppableContainer) {
if(droppableContainer) {
// drop is valid
}else {
// drop is invalid
}
return(!droppableContainer) //returns the draggable to its original position
}
});