Jquery UI slider gives access to class ui-slider-range
to do custom css on the selected range. Is there an easy way to add custom css (in my case background color) to what is left and right of the selected range?
Changing the slider background color changes both left and right, I however want a trio effect essentially of 3 separate background colors for the 3 divided regions created by the range min/max selectors;
You could use jQuery to add a
background-image
style property to your.ui-slider
. You'll have to calculate the position of the sliders as a percentage.For example, check out the CSS
Your jQuery would update the style for that specific slider whenever the user moves the slider. Check out this jsFiddle.
Note, you'll have to find a way to initially color the left/right side. Also, there are a few browser-specific
background-image
properties, see this answer.