different speed of animation requestAnimFrame java

2019-08-20 09:30发布

问题:

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?

回答1:

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

http://blogs.msdn.com/b/ie/archive/2011/07/05/using-pc-hardware-more-efficiently-in-html5-new-web-performance-apis-part-1.aspx