Why does jQuery animate bring a box to the right, and then to the bottom, and stop at that point?
I’m trying to get a box through a complete circle(or square to be exact) so that the box will return to its original position.
Here’s the jsfiddle: http://jsfiddle.net/QZWDs/
An element can have either a
topor abottomposition and either aleftor aright. It doesn’t make sense to have all four. Use this to do the animation you want:This uses only the
topandleftpositions to animate it. Also it takes advantage of chaining, rather than calling$(".block")each time which creates a new jQuery object.