-
Notifications
You must be signed in to change notification settings - Fork 13
/
prod.html
50 lines (44 loc) · 1.45 KB
/
prod.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<title>rangeslider-js</title>
<link rel="stylesheet" type="text/css" href="styles.min.css">
</head>
<body>
<div>
<div class="first">
<input type="range" data-rangeslider>
</div>
<div class="second">
<input type="range" min="0" max="5" value="1" data-rangeslider>
<div class="output"></div>
</div>
<div class="third">
<input type="range" min="-10" max="400" step="2" value="40" data-rangeslider>
<div class="output"></div>
</div>
<br><br>
</div>
<script type="text/javascript" src="rangeslider-js.min.js"></script>
<script type="text/javascript">
var sliderEl1 = document.querySelector('.first [data-rangeslider]')
var sliderEl2 = document.querySelector('.second [data-rangeslider]')
var sliderEl3 = document.querySelector('.third [data-rangeslider]')
sliderEl2.addEventListener('input', (ev) => {
document.querySelector('.second .output').innerHTML = ev.target.value
})
sliderEl3.addEventListener('input', (ev) => {
document.querySelector('.third .output').innerHTML = ev.target.value
})
rangesliderJs.create(sliderEl1, {min: 0, max: 5, step: 0.5})
rangesliderJs.create(sliderEl2)
rangesliderJs.create(sliderEl3, {
onSlide: function () {
console.log(this)
}
})
</script>
</body>
</html>