Draggable behavior

I want to drag objects from one part of the screen to another (like a chess board). I’ve added draggable behavior but I want to know when stopped to drag and if it has been dragged into a valid place, if not return the object to its original place.
Any ideas??