【发布时间】:2015-03-04 12:49:52
【问题描述】:
当我在 Iphone 上测试这个 CSS3 动画时,谁能告诉我为什么它拒绝工作?它在 Chrome 上运行良好。
.heartbeat:after {
content: "\f118";
font-family: fontAwesome;
font-size: 50px;
color: rgb(0, 156, 255);
-webkit-animation: spin 1000ms ease 0s infinite normal;
-moz-animation: spin 1000ms ease 0s infinite normal;
-ms-animation: spin 1000ms ease 0s infinite normal;
-o-animation: spin 1000ms ease 0s infinite normal;
animation: spin 1000ms ease 0s infinite normal;
}
@-ms-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
我检查了类似的问题并尝试将from和to替换为0%和100%,并且一次旋转180度,改用rotate3d;没用。
【问题讨论】:
-
你在Desktop Safari上测试过吗?我的预感是这可能与 Safari 而不是 iOS 特定问题有关。
-
Applying WebKit transitions to Pseudo Elements 的可能重复项。显然这现在已在 Chrome 中修复,但尚未在 Safari 中修复 css-tricks.com/…
-
你在 moz 动画上使用 webkit 前缀?与 -ms- 前缀一样吗?