Hey there!
I've been experimenting with animating absolutely positioned DIVs on my webpage using some JavaScript to update the top and left CSS properties. It's been working smoothly in Chrome, Firefox, and even Internet Explorer 8. However, I encountered a strange issue when testing it in Safari 5 - the DIVs just remain static. Oddly enough, if I resize the Safari window, they suddenly start moving...
If you're curious, you can check out a demo of what I'm talking about here:
The code used to update the DIVs is quite simple, just a snippet of jQuery (which also handles rotation perfectly 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 tried adding position:relative to the body, as well as including 'px' and rounding down the values in case Safari was finicky about long floating point numbers. Sadly, no luck - the DIVs stubbornly refuse to budge until the window gets resized...
If you have any insights or suggestions, they would be greatly appreciated!
Thanks for reading, Chris.