-
Notifications
You must be signed in to change notification settings - Fork 3
/
Slider.html
122 lines (119 loc) · 3.43 KB
/
Slider.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE HTML>
<html lang="pt-br">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="true">
<meta name="MobileOptimized" content="width">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Slider</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="robots" content="index, follow" />
<meta name="author" content="Wallace Erick" />
<style type="text/css">
body {
overflow:hidden;
}
#main {
width: 300px;
margin: 100px auto;
padding: 40px 20px;
background:#ccc;
font-size: 16px;
line-height: 24px;
}
.mod-input-slider {
width: 300px;
margin: 0 auto;
}
.mod-is-container {
width: 280px;
height: 10px;
padding: 6px 10px;
display: block;
overflow: visible;
position: relative;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3) inset, 0 1px 0 rgba(255, 255, 255, .5);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3) inset, 0 1px 0 rgba(255, 255, 255, .5);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3) inset, 0 1px 0 rgba(255, 255, 255, .5);
}
.snapping .mod-is-container {
width: 290px;
height: 24px;
margin: 0 auto;
padding: 0 5px;
-webkit-border-radius: none;
-moz-border-radius: none;
border-radius: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.mod-is-knob {
width: 23px;
height: 23px;
display: block;
position: absolute;
left: 0;
top: 0;
background: transparent url('http://maxdegterev.name/experiments/zslider/static/input_slider_knob.png') no-repeat;
-webkit-background-size: 23px;
background-size: 23px;
}
.mod-is-track {
width: 280px;
height: 8px;
display: block;
background: transparent url('http://maxdegterev.name/experiments/zslider/static/input_slider_bg.png') no-repeat -300px 0;
-webkit-background-size: 600px 8px;
background-size: 600px 8px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, .3);
}
.snapping .mod-is-track {
width: 290px;
height: 24px;
display: block;
background: none;
-webkit-border-radius: none;
-moz-border-radius: none;
border-radius: none;
border: none;
}
.snapping.points3 .mod-is-track {
background: transparent url('http://maxdegterev.name/experiments/zslider/static/input_slider_sp3_bg.png') no-repeat 0 3px;
-webkit-background-size: 290px 17px;
background-size: 290px 17px;
}
</style>
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript" src="js/islider.js"></script>
<script type="text/javascript" src="js/slider.js"></script>
<script type="text/javascript">
Zepto(function($){
var sliders = $('.mod-input-slider'),
simple = sliders.not('.snapping'),
snapping = sliders.filter('.snapping');
simple.inputSlider();
snapping.inputSlider({ type: 'snap', points: 3});
});
</script>
</head>
<body>
<div id="main">
<div class="mod-input-slider"> <span class="mod-is-container"> <i class="mod-is-knob"></i> <b class="mod-is-track"></b> </span>
<input class="mod-is-input" data-percent="0" type="hidden" name="somename" value="">
</div>
<br />
<div class="mod-input-slider snapping points3"> <span class="mod-is-container"> <i class="mod-is-knob"></i> <b class="mod-is-track"></b> </span>
<input class="mod-is-input" type="hidden" name="othername" value="">
</div>
</div>
</body>
</html>