views:

23

answers:

3

How to change a background color of jQueryUI Progressbar?

Im trying to use:

$('#progressbar div').css({backgroundColor: '#9CFF29'});

but no success :(

Anybody can help me? Thanks!

A: 

Make sure you are selecting the div. Are you able to change other properties of #progressbar such as width?

joe
+1  A: 

The selector should be on the main <div> so just use #progressbar and to override the styling, use just background (since it also has an image defined as well), like this:

$('#progressbar').css({background: '#9CFF29'});​

You can test it out here.

Nick Craver
on this page: http://jqueryui.com/demos/progressbar/ changing neither `#progressbar` nor `#progressbar div` works, because the progress bar loads a background image in addition to the bgcolor, after removing the `background-image`, `#progressbar div` selector is the one that works.
aularon
@aularon - I'm not changing `backgroundColor` in the answer :) That's why I noted it should be `background`, so it overrides the `background-image` *and* `background-color` properties :)
Nick Craver
Oh, sorry I was busy checking that page and commented quickly. btw how did you get your nickname on jsfiddle? :)
aularon
@aularon - If you're logged in that's how the links are generated, beta will be open for users very soon :)
Nick Craver
A: 

jQuery UI Progressbar plugin uses the jQuery UI CSS Framework to style its look and feel, including colors and background textures. We recommend using the ThemeRoller tool to create and download custom themes that are easy to build and maintain.

http://jqueryui.com/themeroller/

rjovic