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'
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…