【发布时间】:2013-10-24 13:01:58
【问题描述】:
我制作了一个小的背景动画,其中 div 会随着时间的推移改变颜色。 它运行平稳,但是当它达到 100% 时,它会直接跳到 0%,没有任何过渡。 我在谷歌上搜索并尝试了不同的动画制作方式,但如果动画我无法获得流畅的“重启”。
我错过了什么?
-webkit-animation: pulsate 20s infinite;
animation: pulsate 20s infinite;
-moz-animation: pulsate 20s infinite;
@-webkit-keyframes pulsate {
0% {background: @black}
25% {background: @red}
50% {background: @blue}
75% {background: @orange}
100% {background: @green}
}
@keyframes pulsate {
0% {background: @black}
25% {background: @red}
50% {background: @blue}
75% {background: @orange}
100% {background: @green}
}
@-moz-keyframes pulsate {
0% {background: @black}
25% {background: @red}
50% {background: @blue}
75% {background: @orange}
100% {background: @green}
}
【问题讨论】:
标签: css css-animations