Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change background color of JQuery slider

Tags:

I understand I can set the background color of the value from min to the current slider selection by doing a:

#slider .ui-slider-range { background: #88ac0b; }

How do I set the background color for the entire slider (not just from the min or max to the selected value)

like image 584
DotnetDude Avatar asked Mar 07 '10 01:03

DotnetDude


People also ask

How can set background color in jQuery?

To set the background color using jQuery, use the jQuery css() property. We will set background color on mouse hover with the jQuery on() method.


1 Answers

i tried some of the other answers, but none of them seemed to work by themselves. this worked for me to get both the range and the rest of the slider to be the same color:

$( "#my-slider" ).css('background', 'rgb(0,255,0)');
$( "#my-slider .ui-slider-range" ).css('background', 'rgb(0,255,0)');
like image 146
Bruce Chu Avatar answered Oct 26 '22 09:10

Bruce Chu