"Anirudha Bhowmik range slider value change"
Bootstrap 4.1.1 Snippet by anirudhabhowmik

1
2
3
4
5
6
7
8
9
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="slideContainer">
<label class="range_value"><span id="value"></span></label>
<input type="range" min="0" max="100" value="1" class="slider" id="myRange">
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
input[type=range]::-webkit-slider-thumb{
-webkit-appearance: none;
border: 1px solid #000000;
height: 20px;
width: 20px;
border-radius: 50%;
border-radius: 3px;
background: #000;
cursor: pointer;
}
.range_value{
padding: 4px 25px;
border: 2px solid #000;
background-color: #fff;
color: #000;
border-radius: 8px;
font-weight: 400;
position: relative;
}
.range_value::after{
content: " ";
position: absolute;
top: 100%;
left: 50%;
margin-left: -8px;
border-width: 8px;
border-style: solid;
border-color: black #9a9a9a00 transparent transparent;
}
.slider {
-webkit-appearance: none;
width: 150px;
height: 20px;
background: linear-gradient(90deg, rgb(0, 0, 0) 5%, rgb(214, 214, 214) 0%);
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
var slider = document.getElementById("myRange");
var output = document.getElementById("value");
output.innerHTML = slider.value;
slider.oninput = function() {
output.innerHTML = this.value;
}
slider.addEventListener("mousemove", function() {
var x = slider.value;
var color = 'linear-gradient(90deg, rgb(0, 0, 0)' + x + '% , rgb(214, 214, 214)' + x + '%)';
slider.style.background = color;
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: