I have a page with several bootstrap progress bars. Setting their values initially works fine. Though I would like the progress bars to animate/transition to their specific states when a user opens the page.
This JS works fine, when you click on one of the bars. I would need something like that on an "onload" event of the bar. But the "onload" event is not available for s
//animate progress bars
$('.progress .bar').on("click", function(event) {
var me = $(this);
perc = me.attr("data-percentage");
me.css('width', perc+'%');
});
How can I achieve this behavior on page load for all progress bars on a page?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…