javascript - jQuery slider 在 Chrome 中表现得很奇怪(+其他问题)

标签 javascript jquery google-chrome jquery-plugins slider

目前正在开发一个带有 slider 的网站,该 slider 在 Chrome 中出现问题,并且已经成为一个问题。

http://firedogpr.com/index.php - 带有 5 张幻灯片的顶部横幅,使用 jquery Blend 往往不会随机加载某些图像,并且在网站上运行大约 5-10 分钟时会加速或停止工作。我有另一个网站使用不同的 slider ,也出现了同样的问题,所以它可能不仅仅是插件的问题。我按照 http://www.snowdenindustries.com/ 上的 slider 对其进行了建模事实上,使用了相同的 js 文件和 div 标签,尽管效果很好。

Firefox 中出现的问题很少,但通常是在更改选项卡时出现。

有什么想法吗?

在 Mac OSX 上使用 Chrome 17.0.963.46

更新:在 Windows 中的 Chrome、Firefox 或 IE 上根本不起作用。我合作伙伴的 Mac 笔记本电脑在他的浏览器中也遇到了同样的问题。

最佳答案

来自Chromium blog :

Unfortunately, setTimeout and setInterval don’t take into consideration whether the destination element, or even the tab that contains it, is actually visible. So, pages with high-frequency timers will consume CPU resources even if the tab is in the background. On laptops, netbooks, and mobile devices of all kinds, reducing CPU consumption is essential in order to prolong battery life. Additionally, excess CPU consumption by background tabs reduces the smoothness of animations on the foreground tab. ...

In the forthcoming Chrome 11 release, we plan to reduce CPU consumption even for pages that are using setTimeout and setInterval. For background tabs, we intend to run each independent timer no more than once per second. This change has already been implemented in the Chrome dev channel and canary builds. While there may be some compatibility impact for web pages, we believe that improving the user experience for the foreground tab, and increasing battery life, are problems needing to be addressed.

关于javascript - jQuery slider 在 Chrome 中表现得很奇怪(+其他问题),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9279603/

相关文章:

javascript - Bootstrap 4 : How to make the item of list-group active when clicking it via jquery or vuejs?

javascript - 无法从闭包内输出正确的变量值

php - 更多重定向后获取问题,我做错了什么

javascript - jquery.inputmask - 在 "oncomplete"回调中设置值使操作不正确

javascript - 在调用函数之前执行 Greasemonkey 脚本中的代码

javascript - 如何选择当前 DIV ID 以使用该 ID 运行 Jquery?

javascript - 只允许输入 2 位小数

javascript - 替换数组中的输入值时出现问题

javascript - Chrome 内存/垃圾收集问题

javascript - Angular js json.stringify 到 php