How to change the color of a bootstrap (twitter) progress bar at runtime

后端 未结 4 451
广开言路
广开言路 2020-12-09 18:06

I am using this progress bar :

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

And would like to give it a custom color, known only at runtime (

4条回答
  •  时光说笑
    2020-12-09 18:47

    You should change the container div class in order to change the color.

    Example using .progress-danger for red color:

    More colors (just substitute button for progress in the class name). http://twitter.github.com/bootstrap/base-css.html#buttons

    Update: In order to add the class name at runtime with javascript take a look at http://snipplr.com/view/2181/ or http://api.jquery.com/addClass/ if you are using jQuery.

    Hope it helps.

提交回复
热议问题