Having trouble animating progress bars with jQuery? I am facing a unique issue where my progress bars are behaving in an unexpected way when using the jQuery animate()
method. My goal is to animate each progress bar individually with a 0.1s delay. I need guidance on selecting the appropriate animation effect as my current one seems to be moving downwards. Can someone assist me in achieving this in the simplest manner possible?
Below is my current code snippet:
$('.vertical-bars .progress-fill span').each(function() {
var percent = $(this).html();
var pTop = 100 - (percent.slice(0, percent.length - 1)) + "%";
$(this).parent().css({
'height': percent,
'top': pTop
});
$(this).parent().animate({
height: "toggle"
}, {
duration: 900,
specialEasing: {
height: "swing"
}
});
});
You can view and test my progress bars setup on JSFiddle HERE.
The desired behavior should see the progress bars filling upwards, similar to the example provided HERE.