different speed of animation requestAnimFrame javascript
-
21-04-2021 - |
题
I have a problem with window.requestAnimFrame. It works in different ways in FF,Chrome and in IE9,Opera. For example this http://jsfiddle.net/vZP3u/2/ (tacked from another question about requestAnimFrame). It shows about 60 fps (I guess should be 30) in FF 9.0.1 and Chrome 16.0.912.77 m. But It works fine in IE9 and Opera. Have you any idea how to fix this?
解决方案
Opera and IE do not support requestAnimationFrame
yet. So your code runs at 33ms setTimeout
fallback.
More ontopic:
http://paulirish.com/2011/requestanimationframe-for-smart-animating/
http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
https://developer.mozilla.org/en/DOM/window.requestAnimationFrame
不隶属于 StackOverflow