Link: http://jsfiddle.net/kbJCc/1/
Unfortunately I can’t even perform the most simple animation with jquery right now.
I’ve got a quadratic div separated in 4 buttons. Each button represents one corner of my screen. So if I press btn1 my quadrativ div should animate to the upper-left corner.
btn2 should animate the div to the upper-right. btn3 bottom left a.s.o.
Now there are two problems:
1. animation is not smooth in safari & chrome (it jumps from one corner to an other)
2. If I have clicked all (one after the previous animation) the div is stuck in the upper left corner.
Firebug told me that my div keeps all of the css rules applied by $.animate()?!
Hopefully someone out here can help me.
Thank you so much.
Btw. the div initially should have been centered on my window 🙂
I have updated your jsfiddle. Basically, I gave the element containing
main-menustatic dimensions so that the JavaScript has something from which to calculate positions. I then initialized themain-menuelement to the “center” of the document via JavaScript once the DOM is ready (technically, this could, and should, be done in the stylesheet). Finally, I updated your animations to explicitly animate all sides of themain-menuelement.