-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
84 lines (74 loc) · 1.69 KB
/
example.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<html>
<head></head>
<body>
<div id="vjik">
<div id="vjik-range"></div>
<div class="vjik-handle" id="vjik-handle-start"></div>
<div class="vjik-handle" id="vjik-handle-stop"></div>
<div class="vjik-handle" id="vjik-handle-stop2"></div>
</div>
<style type="text/css">
#vjik {
width: 10px;
height: 300px;
background: green;
display: flex;
flex-direction: column;
align-items: center;
}
.vjik-handle {
width: 40px;
height: 40px;
border-radius: 50%;
border: 1px solid grey;
transition: transform 0.3s ease;
}
#vjik-range {
background: blue;
width: 20px;
}
#vjik-handle-start {
background: red;
}
#vjik-handle-stop {
background: yellow;
}
</style>
<script type="text/javascript" src="dist/vjik.js"></script>
<script type="text/javascript">
const slider = Vjik({
el: document.getElementById('vjik'),
min: 0,
max: 200,
step: 20,
vertical: true,
handles: {
start: {
el: document.getElementById('vjik-handle-start'),
min: 10,
max: 100,
onChange (val) { console.log(val) },
},
stop: {
el: document.getElementById('vjik-handle-stop'),
},
stop2: {
el: document.getElementById('vjik-handle-stop2'),
},
},
ranges: [
{
// el: document.getElementById('vjik-range'),
start: 'start',
stop: 'stop',
},
{
el: document.getElementById('vjik-range'),
start: 'stop',
stop: 'stop2',
},
],
});
</script>
</body>
</html>