Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
工作样本:http: //jsfiddle.net/murano55/bSPeC/2/
为什么第二个 div (2 .BOX) 左侧位置错误?谢谢。
http://jsfiddle.net/bSPeC/10/
不要在事件ui.position.内部使用,而是使用drag$(this).position().
ui.position.
drag
$(this).position().
您需要自己减去#container边框。
#container
你需要你 offset() 而不是 position
http://jsfiddle.net/bSPeC/14/