不同速度的动画requestAnimFrame的JavaScript [英] different speed of animation requestAnimFrame javascript

查看:1144
本文介绍了不同速度的动画requestAnimFrame的JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有window.requestAnimFrame问题。
它的工作原理在FF,Chrome和IE9中,歌剧不同的方式。
例如,这 http://jsfiddle.net/vZP3u/2/ (从约requestAnimFrame另一个问题上涨)。
 它显示了约60帧(我猜应该是30),FF 9.0.1和Chrome 16.0.912.77米
但它工作在IE9和Opera罚款。
你有任何想法如何解决这一问题?

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和IE浏览器不支持 requestAnimationFrame 呢。所以,你的code运行在为33ms 的setTimeout 回落。

Opera and IE do not support requestAnimationFrame yet. So your code runs at 33ms setTimeout fallback.

更多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

<一个href=\"http://blogs.msdn.com/b/ie/archive/2011/07/05/using-pc-hardware-more-efficiently-in-html5-new-web-performance-apis-part-1.aspx\" rel=\"nofollow\">http://blogs.msdn.com/b/ie/archive/2011/07/05/using-pc-hardware-more-efficiently-in-html5-new-web-performance-apis-part-1.aspx

这篇关于不同速度的动画requestAnimFrame的JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆