我的页面上有几个Bootstrap进度条。设置它们的值最初是没有问题的。但我想让进度条在用户打开页面时动画/过渡到它们特定的状态。
这个JS在你点击其中一个进度条时可以正常工作。我需要像这样的东西在进度条的"onload"事件上。但是"onload"事件不适用于s。
//animate progress bars
$('.progress .bar').on("click", function(event) {
var me = $(this);
perc = me.attr("data-percentage");
me.css('width', perc+'%');
});
如何在页面加载时为页面上的所有进度条实现此行为?
:)
- Tats_innit