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

后端 未结 4 538
广开言路
广开言路 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:57

    Your code is actually working, just that the progress bar is actually using a gradient as a color instead of a solid background-color property. In order to change the background color, set the background-image to none and your color will be picked up:

    $('#pb').css({
        'background-image': 'none',
        'background-color': 'red'
    });
    

提交回复
热议问题