【发布时间】:2020-03-26 20:36:36
【问题描述】:
我有这个关键帧动画,它应该在 50% 标记处更改 div 的颜色,然后在 2 秒延迟后,它应该为另一个 div 设置动画。之后是另一个。 然后像这样循环。
但它并没有像它应该的那样工作。它们不是一个接一个地运行,而是同时运行。
我该如何解决这个问题?
div#wifi-waves svg path#w01 {
-webkit-animation: colorchnage 1s infinite;
animation: colorchnage 1s infinite;
}
div#wifi-waves svg path#w02 {
-webkit-animation: colorchnage 1s infinite;
animation: colorchnage 1s infinite;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
div#wifi-waves svg path#w03 {
-webkit-animation: colorchnage 1s infinite;
animation: colorchnage 1s infinite;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
div#wifi-waves svg path#w04 {
-webkit-animation: colorchnage 1s infinite;
animation: colorchnage 1s infinite;
-webkit-animation-delay: 2s;
animation-delay: 2s;
}
@-webkit-keyframes colorchnage {
0% { fill: #ecf0f1; }
50% { fill: rgba(26, 60, 88, 0.9); }
100% { fill: #ecf0f1; }
}
@keyframes colorchnage {
0% { fill: #ecf0f1; }
50% { fill: rgba(26, 60, 88, 0.9); }
100% { fill: #ecf0f1; }
}
SVG:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 60 45" xml:space="preserve" preserveAspectRatio="xMixYMid">
<path id="w04" d=""></path>
<path id="w03" d=""></path>
<path id="w02" d=""></path>
<path id="w01" d=""></path>
</svg>
【问题讨论】:
标签: css svg css-animations