I tried to figure out this issue. How do I stop the progress bar after the animation ends?
ul li {list-style:none;}
li {width:100%;height:30%;background-color:#ccc;margin-top:20px;position:relative;}
.skillsBar ul li .bar{
animation: Ani linear 7s 1 normal;background-color:#f00;height: 100%; position: absolute; top:0;
}
.skillsContWrpa .skillsBar ul li .bar{
animation-name:Ani;
animation-duration: 7s;
animation-iteration-count: 1;
animation-timing-function: ease;
animation-direction: alternate;
animation-fill-mode: both;
}
@keyframes Ani {
0% { width:0%; }
100% { width:90%; }
}
<div class="skillsBar">
<ul>
<li><span>PHOTOSHOP 90%</span>
<div class="bar"></div>
</li>
<li><span>HTML CSS 80%</span></li>
<li><span>DEVELOPMENT 70%</span></li>
<li><span>MARKETING 80%</span></li>
</ul>
</div>
2
Answers
I think this is what you are looking for: Solution to your question – Codepen link
You have to use this basic structure:
Inside
data-percent=""
you can put any percentage and animation will work accordingly.add “animation-fill-mode: forwards;” to your css class “.bar”
values that is set by the last keyframe.