-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (68 loc) · 2.36 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
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="sliders">
<div class="row">
<div class= "col-xs-5">
</div>
<div class= "col-xs-2">
<div class= "slider" >
<h4>R</h4>
<input type="range" min="0" max="255" value="1" step="5" onchange="showValue(this.value, 'R')" />
<span id="R">0</span>
</div>
</div>
</div>
<div class="row">
<div class= "col-xs-5">
</div>
<div class= "col-xs-2">
<div class= "slider" >
<h4>G</h4>
<input type="range" min="0" max="255" value="1" step="5" onchange="showValue(this.value, 'G')" />
<span id="G">0</span>
</div>
</div>
</div>
<div class="row">
<div class= "col-xs-5">
</div>
<div class= "col-xs-2">
<div class= "slider" >
<h4>B</h4>
<input type="range" min="0" max="255" value="1" step="5" onchange="showValue(this.value, 'B')" />
<span id="B">0</span>
</div>
</div>
</div>
</div>
</body>
</html>
<style>
.sliders{
margin-top: 25% ;
margin-bottom: auto;
background-color: whitesmoke;
font-family: monospace;
}
</style>
<script type="text/javascript">
var R;
var G;
var B;
function showValue(newValue,id)
{
if(id == "R") R = newValue;
else if(id == "G") G == newValue;
else B == newValue;
document.getElementById(id).innerHTML=newValue;
}
</script>