Restrict jQuery draggable items from overlapping/colliding with sibling elements

Edit: New Solution I found a plugin for this called JQuery UI Draggable Collision. Using this, implementing your desired functionality becomes trivial. See the following jsFiddle example: http://jsfiddle.net/q3x8w03y/1/ (This uses version 1.0.2 of JQuery UI Draggable Collision, along with JQuery 1.7.2 and JQueryUI 1.1.18.) Here is the code: $(“#dragMe”).draggable({ obstacle: “#butNotHere”, preventCollision: true, containment: “#moveInHere” … Read more