没有动画将进度条重置为零(在引导程序中)

Pra*_*odh 7 javascript css jquery twitter-bootstrap

我有多个要执行的操作,我正在使用bootstrap进度条来显示每个操作的进度.完成每个操作后,使用下面的代码行$('.progress')将进度条设置为零.attr('style',"width:0%")

但是,这反过来动画,对于用户来说,应用程序似乎正在撤消之前执行的操作.

如何在没有反向动画效果的情况下立即重置进度条?

MOD*_*MOD 10

您可以按照此答案中的说明删除进度条的转换

.notransition {
  -webkit-transition: none !important;
  -moz-transition: none !important;
  -o-transition: none !important;
  -ms-transition: none !important;
  transition: none !important;
}
$(".progress-bar").addClass("notransition");
$('.progress-bar').attr('style', "width: 0%");
Run Code Online (Sandbox Code Playgroud)

如果您愿意,可以通过删除notransition类来再次启用转换

$(".progress-bar").removeClass("notransition");
Run Code Online (Sandbox Code Playgroud)