different speed of animation requestAnimFrame javascript

余生长醉 提交于 2019-12-11 15:35:14

问题


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



来源:https://stackoverflow.com/questions/9078645/different-speed-of-animation-requestanimframe-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!