svg {
width: 300px;
}
#frame1 {
visibility: hidden;
animation: 1s show infinite;
}
#frame2 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.125s;
}
#frame3 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.25s;
}
#frame4 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.375s;
}
#frame5 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.5s;
}
#frame6 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.625s;
}
#frame7 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.75s;
}
#frame8 {
visibility: hidden;
animation: 1s show infinite;
animation-delay: 0.865s;
}
@keyframes show {
0% { visibility: visible;}
12.5% { visibility: visible; }
12.6% { visibility: hidden; }
100% { visibility: hidden; }
}
<svg viewBox="0 0 300 300">
<g id="frame1">
<circle cx="150" cy="50" r="25"/>
</g>
<g id="frame2">
<circle cx="250" cy="50" r="25"/>
</g>
<g id="frame3">
<circle cx="250" cy="150" r="25"/>
</g>
<g id="frame4">
<circle cx="250" cy="250" r="25"/>
</g>
<g id="frame5">
<circle cx="150" cy="250" r="25"/>
</g>
<g id="frame6">
<circle cx="50" cy="250" r="25"/>
</g>
<g id="frame7">
<circle cx="50" cy="150" r="25"/>
</g>
<g id="frame8">
<circle cx="50" cy="50" r="25"/>
</g>
</svg>
</svg>
是红色的。这表明存在一些错误的嵌套。您可能错过了某个</g>
,并且第7帧继承了先前帧的fill
- 将白色牙齿变黑。 - Paul LeBeaust2
替换为st1
后,牙齿并没有变黑。然而,在这两个问题得到解决之后,仍然感觉每个周期会出现闪烁。你能帮忙评论一下原因和解决方法吗? :D - SOUser