This is somehow related to the first selected square having the top property set using the CSS selector. Take a look at this fiddle: http://jsfiddle.net/XYLCH/2/
I removed the .selected selector in your CSS and added style="top: 50px;" as an attribute for the first div. I also added top: 10px to the CSS .squares selector to prevent square jumps for the first time.
The problem is this: you add the .selected class to the square that is about to move, which sets the top property to 50px . Then you try to animate it to top: 50px , but it already exists because you added the .selected class.
source share