所以我知道 JS setInterval 在 ios 和 android 中有问题。我最近发现 css 中的动画延迟也有问题。我有一个加载微调器,它有 8 个会增长/收缩的点,并且微调器会旋转。所以在开始时,顶部的点让动画增长,然后下一个点有一个延迟,然后动画也被应用。这使它看起来像是在追逐一圈红点。
这是所需外观的小提琴。http://jsfiddle.net/3xjRF/
然而,在 iOS 和 Android 上,延迟是奇怪的。有时前 5 个点会同时开始动画或其他。关键是延迟要么不被尊重,要么被舍入,要么被应用在不同的时间。
任何想法如何让 css 动画延迟在 iOS webview 中正常工作?我尝试使用 scale3d 以便它可以在 GPU 中运行,但即便如此,延迟仍然是主要问题。我想用 css vs gif 或其他什么来做。
#circularG {
width: 90px;
height: 90px;
position: relative;
margin:0 auto;
top: 39%;
z-index: 10000;
}
.circularG {
position: absolute;
background-color: #d4242c;
width: 20px;
height: 20px;
-webkit-border-radius: 14px;
-moz-border-radius: 14px;
-webkit-animation-name: bounce_circularG;
-webkit-animation-duration: 1.28s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-direction: linear;
-moz-animation-name: bounce_circularG;
-moz-animation-duration: 1.28s;
-moz-animation-iteration-count: infinite;
-moz-animation-direction: linear;
border-radius: 14px;
-o-animation-name: bounce_circularG;
-o-animation-duration: 1.28s;
-o-animation-iteration-count: infinite;
-o-animation-direction: linear;
-ms-animation-name: bounce_circularG;
-ms-animation-duration: 1.28s;
-ms-animation-iteration-count: infinite;
-ms-animation-direction: linear;
}
#circularG_1 {
left: 0;
top: 35px;
-webkit-animation-delay: 0.4800000000000001s;
-moz-animation-delay: 0.4800000000000001s;
-o-animation-delay: 0.4800000000000001s;
-ms-animation-delay: 0.4800000000000001s;
}
#circularG_2 {
left: 10px;
top: 10px;
-webkit-animation-delay: 0.64s;
-moz-animation-delay: 0.64s;
-o-animation-delay: 0.64s;
-ms-animation-delay: 0.64s;
}
#circularG_3 {
top: 0;
left: 35px;
-webkit-animation-delay: 0.8s;
-moz-animation-delay: 0.8s;
-o-animation-delay: 0.8s;
-ms-animation-delay: 0.8s;
}
#circularG_4 {
right: 10px;
top: 10px;
-webkit-animation-delay: 0.9600000000000002s;
-moz-animation-delay: 0.9600000000000002s;
-o-animation-delay: 0.9600000000000002s;
-ms-animation-delay: 0.9600000000000002s;
}
#circularG_5 {
right: 0;
top: 35px;
-webkit-animation-delay: 1.12s;
-moz-animation-delay: 1.12s;
-o-animation-delay: 1.12s;
-ms-animation-delay: 1.12s;
}
#circularG_6 {
right: 10px;
bottom: 10px;
-webkit-animation-delay: 1.28s;
-moz-animation-delay: 1.28s;
-o-animation-delay: 1.28s;
-ms-animation-delay: 1.28s;
}
#circularG_7 {
left: 35px;
bottom: 0;
-webkit-animation-delay: 1.44s;
-moz-animation-delay: 1.44s;
-o-animation-delay: 1.44s;
-ms-animation-delay: 1.44s;
}
#circularG_8 {
left: 10px;
bottom: 10px;
-webkit-animation-delay: 1.6s;
-moz-animation-delay: 1.6s;
-o-animation-delay: 1.6s;
-ms-animation-delay: 1.6s;
}
@-webkit-keyframes bounce_circularG {
0% {
-webkit-transform:scale(1)
}
100% {
-webkit-transform:scale(.3)
}
}
@-moz-keyframes bounce_circularG {
0% {
-moz-transform:scale(1)
}
100% {
-moz-transform:scale(.3)
}
}
@-o-keyframes bounce_circularG {
0% {
-o-transform:scale(1)
}
100% {
-o-transform:scale(.3)
}
}
@-ms-keyframes bounce_circularG {
0%{
-ms-transform:scale(1)
}
100% {
-ms-transform:scale(.3)
}
}
谢谢