tuia-fed / issues-h5

2 stars 0 forks source link

ios 不兼容 animation-play-state #4

Open deshes opened 7 years ago

deshes commented 7 years ago

目前没有很好的解决方式 只能换种方式停止动画

deshes commented 7 years ago

https://stackoverflow.com/questions/27683012/css-animation-play-state-paused-doesnt-work-in-ios

iOS 8-9 Safari 使用 -webkit-animation: none !important; 替代 -webkit-animation-play-state:paused;  This approach is for GWD, but can apply otherwise Don't use Pause event in GWD (Google Web Designer) Create normal event that calls a javascript function, set "-webkit-animation: none !important;" to the

(you can add/remove css class) CSS Style.no-animation { -webkit-animation: none !important; } Javascriptdiv.className = div.className + " no-animation"; To resume, remove CSS classJavascriptdiv.className = div.className.replace("no-animation", ''); Please note that when remove/pause animation, it will go back to frame 0 (00:00 s), so you may need to calculate the current opacity/position for the div -- | --