jQuery 动画 &闪光灯组合:性能差,fps 低
我目前正在开发一个项目,其中使用 SWFObject 来包含 Flash 标头(一些火焰动画)。此外,我还在页面上使用 jQuery 实现多种动画和效果,例如图像滑块和悬停效果。
我遇到的问题:
- CPU 使用率高:在 Intel Q9550 上约为 50%
- 由于 CPU 使用率高,jQuery 动画的帧速率低
- 当我触发任何 jQuery 动画或效果时,Flash 动画似乎卡住了
我尝试删除几个 jQuery 动画,然后简化了页面,但也只有一个悬停菜单,当悬停菜单时,Flash 动画会卡住,并且 jQuery 动画会滞后。
我的页面运行流畅的浏览器只有 Chrome 和 Opera,但 CPU 使用率很高。 FF3&4 和 IE7-9 始终产生糟糕的帧速率。
我尝试减少 jQuery 内部效果间隔,这似乎有帮助,但动画不再平滑。我是唯一一个遇到这个问题的人吗?我在这里找不到任何其他与该主题相关的帖子?!
测试站点 URL:http://zend.rollingdevils DOT de
Greetings
更新:
问题已解决
我们将计算机的显卡从GeForce 8400GS更改为8800GT。之后,动画运行顺利。没想到是显卡^^
I'm currently working on a project where I use SWFObject to include a flash header (some fire animation). Also I'm using jQuery for several animations and effects on the page, like Imagesliders and hovering effects.
The problems I got:
- high CPU usage: about 50% on a Intel Q9550
- low frame rates of jQuery animations due to the high CPU usage
- The flash animation seem to stuck when i trigger any jQuery animations or effects
I tried to remove several jQuery animations and simplify the page, but also with only an hover menu, the flash animation stucks and the jQuery animations are laggy when hovering the menu.
The only browsers where my page runs smooth are Chrome and Opera, but only with high CPU usage. FF3&4 and IE7-9 produce bad frame rates all time.
I tried to reduce the jQuery internal fx interval, that seems to help, but the animations were not smooth any more. Am I the only one having this issue, i could not find any other postings here with that topic?!
URL to testsite: http://zend.rollingdevils DOT de
Greetings
Update:
Problem solved
We changes the graphic card of the computer, from a GeForce 8400GS to a 8800GT. After that, the animation run smooth. I never thought that it would be the graphic card ^^
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在制作一些同时使用大型 Flash 动画和脚本的网站时也遇到了同样的问题。
在这种情况下,您最好一次只禁用一个脚本,然后每次再次检查结果,看看整体速度是否有所提高,这样您就可以找到较重的脚本。
如果您无法通过这种方式找到它,请尝试一次禁用一个,而不重新启用已禁用的。
在我的网站中,我有很多常见的 jQuery 插件,最后我意识到它们几乎都写得非常糟糕,没有优化的代码。
I had the same problem with some websites I did which used both big flash animations and scripts at the same time.
In this case, the best you can do is disable only one script at a time and every time check the result again to see if the overall speed has improved, that way you can find the heavy script.
If you cannot find it this way, try disabling one at a time without reenabling the already disabled ones.
In my websites I had many common jQuery plugins and in the end I realized they were almost all very bad written, with no optimized code.