There is this progress bar that I am trying to control from javascript. In its demo it has this pretty nice flow, however if I try to set its width with javascript jquery $($0).css({'width': '80%'}), it looses its animation.
.progress-bar {
margin: 0 auto;
width: 100%;
height: 10px;
background-color: #e5e9eb;
}
.progress-bar .progress {
position: relative;
background-color: #90ee90;
height: 10px;
width: 100%;
-webkit-animation-duration: 5s;
-webkit-animation-name: width;
}
.progress-bar .progress .progress-shadow {
background-image: linear-gradient(to bottom, #eaecee, transparent);
position: absolute;
height: 4em;
width: 100%;
top: 100%;
transform: skew(-22.5deg);
transform-origin: 0 0;
}
@-webkit-keyframes width {
0%, 100% {
transition-timing-function: cubic-bezier(1, 0, 0.65, 0.85);
}
0% {
width: 0;
}
100% {
width: 100%;
}
}
How can I control its width without losing its animation?