我制作了一个小背景动画,其中一个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}
}