-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
81 lines (71 loc) · 1.93 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
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
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Range Slider</title>
<link href="range-slider.min.css" rel="stylesheet">
<style>
* {
margin:0;
padding:0;
}
body {
background-color:white;
font:normal normal 13px/1.4 Helmet,Freesans,Sans-Serif;
color:black;
padding:50px 100px 50px 50px;
}
h3 {
font:inherit;
font-weight:bold;
margin:3em 0 1em;
}
.test-result {
position:absolute;
top:10px;
right:10px;
z-index:999;
overflow:hidden;
margin-top:3em;
}
.test-result span {
display:block;
float:right;
clear:right;
background-color:yellow;
border:1px solid;
margin:0 0 2px;
padding:1em;
line-height:1;
}
</style>
</head>
<body style="margin-top:3em;">
<p style="background:salmon;border-bottom:1px dashed;position:absolute;top:0;right:0;left:0;height:3em;line-height:3em;margin:0;padding:0 1em;">Like this project? Please support my <a href="https://github.com/mecha-cms">Mecha CMS</a> project too. Thank you!</p>
<div class="test-result" id="test-result">
<span>0%</span>
<span>0%</span>
</div>
<h3>Horizontal Slider</h3>
<div id="range-slider-1"></div>
<h3>Vertical Slider</h3>
<div id="range-slider-2"></div>
<script src="range-slider.min.js"></script>
<script>
var testResult = document.getElementById('test-result').children;
// horizontal range slider
RS(document.getElementById('range-slider-1'), function(v) {
testResult[0].innerHTML = v + '%';
});
// vertical range slider
RS(document.getElementById('range-slider-2'), {
value: 20, // initial value
vertical: true,
drag: function(v) {
testResult[1].innerHTML = v + '%';
}
});
</script>
</body>
</html>