-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
56 lines (46 loc) · 1.41 KB
/
index.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
51
52
53
54
55
56
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Horizontal Slider Demo</title>
<link href="horizontal-slider.css" media="all" rel="stylesheet" />
<style>
body {
padding: 50px;
}
p.space {
margin-bottom: 40px;
}
#slider-text, #slider-text2 {
color: #e0e0d0;
margin:10px 0 0 5px;
}
</style>
</head>
<body>
<div class="contents">
<hslider id="s1" labelId="slider-text"></hslider>
<div id="slider-text">Drag the knob.</div>
<p class="space"></p>
<hslider id="s2" labelId="slider-text" class="purple"></hslider>
<p class="space"></p>
<hslider id="s3" labelId="slider-text2" class="thin"></hslider>
<div id="slider-text2">Drag the knob.</div>
<p class="space"></p>
<p>
Check out the JavaScript Console.
</p>
</div>
<script src="./horizontal-slider.js" type="text/javascript"></script>
<script>
hslider.initializeSliders();
let slider = hslider.getSliderById("s1"); // Get slider 1
slider.knob.onRangeChanged = function (s) {
console.log("slider:s1", s.knob.range)
}
slider = hslider.getSliderById("s2"); // Get slider 2
slider.knob.onRangeChanged = function (s) {
console.log("slider:s2", s.knob.range)
}
</script>
</body>
</html>