How do I tell Safari iOS7 not to stop css animations on scroll?

柔情痞子 提交于 2019-12-13 21:12:20

问题


I have a rotating css animation that stops when the page is scrolled. I tried enabling the hardware acceleration but without luck.

This doesn't work while the page is scrolled

-webkit-animation: rotating 5s linear infinite;
-webkit-transform-style: preserve-3d;
-webkit-transform: translateZ(0);

回答1:


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).

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.

Here's more: http://eightmedia.github.io/hammer.js/



来源:https://stackoverflow.com/questions/22764189/how-do-i-tell-safari-ios7-not-to-stop-css-animations-on-scroll

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