The JQueryCollision project on SourceForge contains the basic code for finding the overlap between HTML elements, and the JQueryUIDraggableCollision offers the ability to restrict drag-n-drop based on collision information.
JQuery Collision stats: 8851 downloads to date | JQUI Drag Collide stats: 6400 downloads to date |
I wrote these a number of years ago, and I really need to update them for a modern version of JQuery, but I felt they were really neat, so I wanted to display them here. I’ll update the example as I get around to modernizing the code. Here are the working samples: