【发布时间】:2015-10-05 15:20:20
【问题描述】:
@keyframes plusRotate
{
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
green
{
color: #00933B;
animation-name: p1Eat, p1FadeInC, plusRotate;
animation-delay: 10.9s, 15.3s, 21s;
animation-duration: .1s, .7s, .3s;
animation-fill-mode: forwards;
animation-timing-function: linear, linear, linear;
animation-iteration-count: 1, 1, 16;
}
我想让它在“plusRotate”的最后一次迭代中,旋转变慢。 我尝试添加一个单独的动画,其中有 1 次迭代,持续时间更长,但它根本不旋转!基本上我认为它会以某种方式中断。
我的其余代码工作正常,唯一的问题是我希望“+”(字符加号)旋转的部分。现在,它们旋转得很好。唯一的问题是它们不会减速到停止,因为它们被设置为
animation-timing-function: linear
我可以将动画时间设置为任何缓动函数,但它会在每次迭代期间缓动。我希望它持续旋转,并且只在最后一次旋转时放松。知道怎么做吗?
我已经尝试过这样做,但是优点根本没有旋转:
@keyframes plusRotate
{
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
@keyframes plusRotateEnd
{
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
green
{
color: #00933B;
animation-name: p1Eat, p1FadeInC, plusRotate, plusRotateEnd;
animation-delay: 10.9s, 15.3s, 21s, 25.8s;
animation-duration: .1s, .7s, .3s, .5s;
animation-fill-mode: forwards;
animation-timing-function: linear, linear, linear, ease-out;
animation-iteration-count: 1, 1, 15, 1;
}
【问题讨论】:
标签: css iteration css-animations duration keyframe