I am trying to animate some absolutely positioned DIVs on a page, using JS to update the top and left CSS properties. Not a problem in Chrome, FF and even in IE8, but try it in Safari 5, they just sit there ... Strange, if I resized the Safari window, they will update their position ...
Here you can see the demo:
http://www.bikelanebrakes.com/tests/flyingThing1.html
The code that updates the DIVs is really simple, just a little jQuery (also updates the rotation, which works fine in Safari):
$(this.elem).css({ '-webkit-transform': 'rotate(' + (( this.angle * (180 / Math.PI) ) * -1) +'deg)', '-moz-transform': 'rotate(' + (( this.angle * (180 / Math.PI) ) * -1) +'deg)', 'transform': 'rotate(' + (( this.angle * (180 / Math.PI) ) * -1) +'deg)', 'left': Math.round(this.xPos) + 'px', 'top': Math.round(this.yPos) + 'px' });
I added a position: in relation to the body ... I added "px" and rounded the numbers in which Safari did not like the long floating-point values ... Nothing, they just sit there until the window changes ...
Any thoughts or help really appreciated!
Thank you, Chris.
source share