I want the left side to be green and the right side to be gray. As pictured above would be PERFECT. Preferably a pure CSS solution (only need to worry about WebKit).
Is such a thing possible?
I want the left side to be green and the right side to be gray. As pictured above would be PERFECT. Preferably a pure CSS solution (only need to worry about WebKit).
Is such a thing possible?
The previous accepted solution is not working any longer.
I ended up coding a simple function which wraps the
range
into a styled container adding the bar that is needed before the cursor. I wrote this example where easy to see the two colors 'blue' and 'orange' set in the css, so they can be quickly modified.Yes, it is possible. Though I wouldn't recommend it because
input range
is not really supported properly by all browsers because is an new element added in HTML5 and HTML5 is only a draft (and will be for long) so going as far as to styling it is perhaps not the best choice.Also, you'll need a bit of JavaScript too. I took the liberty of using jQuery library for this, for simplicity purposes.
Here you go: http://jsfiddle.net/JnrvG/1/.
above code changes range input style.....
Pure CSS solution:
input[range]
, and fill all the space left to thumb with shadow color.::-ms-fill-lower
::-moz-range-progress
It's now supported with pseudo elements in each of WebKit, Firefox and IE. But, of course, it's different in each one. : (
See this question's answers and/or search for a CodePen titled
prettify <input type=range> #101
for some solutions.A small update to this one:
if you use the following it will update on the fly rather than on mouse release.
"change mousemove", function"