Mission: To swap two boxes on click BOX 1 BOX 2 var box1Pos; var box2Pos; $(".box").click(function(){ box1Pos = $(".box1").offset(); box2Pos = $(".box2").offset(); $(".box1").animate({ left: box2Pos.left, top: box2Pos.top },{ duration: 1500, easing: "easeOutBounce" }); $(".box2").animate({ left: box1Pos.left, top: box1Pos.top },{ duration: 1500, easing: "easeOutBounce" }); });