I am currently working with a progress bar that I need to manipulate using JavaScript. The demo of the progress bar has a smooth animation, but when I try to adjust its width using jQuery $($0).css({'width': '80%'})
, the animation disappears.
.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%;
}
}
Is there a way to adjust the width of the progress bar without disrupting its animation?