div { width:100px; height:100px; position:absolute; } .first { background:red; left:100px; top:100px; } .second { background:blue; left:400px; top:100px; }
elem1:拖拽移动的标签
elem2:检测elem1是否碰撞的标签
fnS:碰撞的回调函数
one:没碰撞的回调函数