如何告诉Safari iOS7不要停止css动画滚动? [英] How do I tell Safari iOS7 not to stop css animations on scroll?
本文介绍了如何告诉Safari iOS7不要停止css动画滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个旋转css动画,当页面滚动时停止。
I have a rotating css animation that stops when the page is scrolled. I tried enabling the hardware acceleration but without luck.
在页面滚动时无效
-webkit-animation: rotating 5s linear infinite;
-webkit-transform-style: preserve-3d;
-webkit-transform: translateZ(0);
推荐答案
这是一个功能,而不是一个错误。 iOS Safari停止所有JS和动画滚动以节省电池寿命(例如,尝试滚动一个动画的GIF页面)。
In short: You can't. It's a feature, not a bug. iOS Safari stops ALL JS and animation on scroll to conserve battery life (try scrolling a page of animated gifs, for instance).
我听说你可以使用锤子。 js使每个滚动一个触摸互动,这将意味着没有这样的警告。但是,它会吸电池。 Hard。
I've heard you can use hammer.js to make every scroll a touch interaction, which would mean no such caveats. However, it will suck batteries. Hard.
以下是更多: http:// eightmedia.github.io/hammer.js/
这篇关于如何告诉Safari iOS7不要停止css动画滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文