Is it possible to make a multicolor "selected region" for the seiyria-bootstrap-slider?
Maybe someone is able to help me. I will attach below my project example, so u can try and test.
var minSliderValue = $("#ex11").data("slider-min");
var maxSliderValue = $("#ex11").data("slider-max");
$('#ex11').slider({
ticks: [1, 2, 3, 5, 10, 25, 50, 100],
ticks_positions: [0, 10, 20, 35, 50, 65, 82.5, 100],
ticks_labels: ["1x", "2x", "3x", "5x", "10x", "25x", "50x", "100x"],
ticks_snap_bounds: 1, //0.5
ticks_tooltip: true,
step: 1,
max: 100, //JS script
tooltip: 'always',
value: 10,
//focus: true,
formatter: function (value) {
return value + 'x';
},
});
$("#input-value").on("keyup", function () {
var val = Math.abs(parseInt(this.value, 10) || minSliderValue);
this.value = val > maxSliderValue ? maxSliderValue : val;
$('#ex11').slider('setValue', val);
});
$("#ex11").slider();
$("#ex11").on("slide", function (slideEvt) {
$("#ex11SliderVal").text(slideEvt.value);
});
#ex11Slider .slider-selection {
background: #FF8282;
}
#ex11Slider .slider-handle {
background: red;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/11.0.2/css/bootstrap-slider.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-slider/11.0.2/bootstrap-slider.js"></script>
<div style="text-align:center">
<br>
<div>
<hr />
<input id="ex11" data-slider-id='ex11Slider' type="text" data-slider-min="0" data-slider-max="100"
data-slider-step="1" />
<span id="ex11CurrentSliderValLabel">Value: <span id="ex11SliderVal">10</span></span>
<hr />
</div>
You can use
linear-gradient
https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient()