I am trying to implement a drag and drop functionality
in a learning application.
this is working good, dropping an item to a droppable area works just as it should.
// Adding drop function to each category
jQuery.each(codes, function (index, value) {
jQuery(value).droppable({
drop: function (event, ui) {
//additional logic here
}
});
});
But if I drag my items and leave them in an undroppable area then it stays there as well.
Help me to make the items droppable to certain divs only, If they are outside those regions then it should go back to the orignal position
I have made a sample fiddle: