gpt4 book ai didi

html - 为什么我的进度条动画在完成时会改变状态?

转载 作者:太空宇宙 更新时间:2023-11-04 09:25:42 24 4
gpt4 key购买 nike

我创建了一个非常简单的动画,它使用 CSS 动画耗尽了进度条。

我遇到的问题是一旦条形图处于 0%(它应该结束的地方,然后再次以 100% 处的条形图结束)

    .w3-progress-container {
width: 100%;
height: 3px;
position: relative;
background-color: #757575;
}
.w3-progressbar {
background-color: #FBCE07;
height: 100%;
position: absolute;
line-height: inherit;
animation: countdown 10s 1;
-webkit-animation: countdown 10s 1;
animation-timing-function: linear;
}
@-webkit-keyframes countdown {
0% { width:100%; }
100% { width: 0%; }
}
  <div class="w3-progress-container">
<div id="myBar" class="w3-progressbar w3-green" style="width:100%"></div>
</div>

最佳答案

去掉 style="width:100%;"并且有效。

据推测,一旦动画完成,它就会恢复到原来的样式。

关于html - 为什么我的进度条动画在完成时会改变状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41110576/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com