Answer the question
In order to leave comments, you need to log in
How to animate not only the stripes, but also the percentage values?
80 /1 / 18
from 0 to the desired number
https://codepen.io/Olya097/pen/BaojdEq
Answer the question
In order to leave comments, you need to log in
$('.progress__item').each(function() {
const $this = $(this);
const $progressBar = $this.find('.progress__bar');
const $value = $this.find('.progress__value');
const value = $progressBar.data('progress-value');
$progressBar.width(`${value}%`);
$({ value: 0 }).animate({
value,
}, {
duration: 1000,
step: val => $value.text(`${val.toFixed(1)} %`),
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question