jquery draggable prevent overlap
问题 I am creating a website, where two div should not overlap each other when dragging them.I have created a jsFiddle file also the following is the code $(".butNotHere").draggable({ obstacle: ".butNotHere", preventCollision: true, containment: "#moveInHere" }); I want to have the same class name for both the div Thanks in advance. 回答1: I came up with sort of a "hack" to deal with this. The issue here is the dragged div is its own obstacle (all share same class). So what I did is remove the class