I'm trying to highlight the background of the slider using the low track (left background of slider) and right track (right side of slider) using bootstrap-slider.
I would like my slider to only reveal a yellow background when the slider moves to the left or right. Similar to how this slider example reveals a black background: https://jsfiddle.net/leongersen/9hyfv0bw/11/
So far the code below is what I have:
https://jsfiddle.net/jimmyt1001/96zj2wnf/9/
#slider12a .slider-track-high, #slider12c .slider-track-high {
background: green;
}
#slider12c .slider-selection {
background: yellow;
}
<input id="ex12c" type="text"/><br/>
$("#ex12c").slider({
id: "slider12c",
min: 0,
max: 40,
range: false,
value: 20 });
Let's do more or less like the example you posted.
You can create a div (let's call its class
middleTrack) with two elements (.leftand.right) absolutely positioned inside it that will have the yellow background.Then, position them and create a function called using the method
.on(slide, middleTrackFunction)that will apply a calculated width relative to the tracker situation. Run it once to apply from the beginning. Also, hide.slider-selectionelement somehow to prevent it from invading the new trackers.jQuery:
CSS: