26

Anyone know a way to disable Bootstrap's CSS3 transitions on the progress bars? I'm updating them via javascript/jquery and don't want them doing the animating.

This looked promising but couldn't get it to work: Turn Off CSS3 Animation With jQuery?

Info on progress bars: http://twitter.github.com/bootstrap/components.html#progress

Community
  • 1
  • 1
user1006426
  • 413
  • 1
  • 5
  • 14

4 Answers4

45

You can turn off the transition effects by setting the css transition rule to none, like so:

.progress .bar {
    -webkit-transition: none;
    -moz-transition: none;
    -ms-transition: none;
    -o-transition: none;
    transition: none;
}​
Andres I Perez
  • 75,075
  • 21
  • 157
  • 138
  • That did it! Should have been looking for the transition property instead. Thanks! – user1006426 Mar 08 '12 at 20:05
  • 6
    Change the CSS selector to just .progress-bar in order to disable the transition effects in Bootstrap 3.0 – Alex Dec 06 '13 at 10:34
  • 1
    I added a new class like `no-transition` with this style marked as `!important` so this way I can selectively turn it off for specific progress bars. – Zoltán Tamási Apr 22 '16 at 13:53
2

Since the animation is comes from the active class you can just use

$('.progress').removeClass('active');

or

$('.progress').toggleClass('active');
vicentedealencar
  • 913
  • 1
  • 10
  • 20
0

I solved the problem with javascript

      $('#proc').hide();
      $("#proc").width(0 + "%");
      $('#proc').show();

For me its working fine. Not flashing and just doing its job. You can also do it with pure css I think.

Johan Hoeksma
  • 3,534
  • 5
  • 28
  • 40
0

You can also do it stopping with $(".progress-bar").stop() the animation and then start it back again.

I wanted to have the bar back to 0 and start again to move to 100%. So here how it goes:

$(".progress-bar").stop();      //Stopping the current animation at the current width
$(".progress-bar").animate({width: "0%"}, 100);       //Going back to 0% smoothly in 100ms
$(".progress-bar").animate({width: "100%"}, 1000);    //Restarting the process bar to 100%

I hope it will help some.

Sylhare
  • 5,907
  • 8
  • 64
  • 80