-
Notifications
You must be signed in to change notification settings - Fork 3
/
inputIncrement.html
127 lines (124 loc) · 4.4 KB
/
inputIncrement.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
123
124
125
126
127
<!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>Input Increment</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-increment {
width: 120px;
display: inline-block;
vertical-align: middle;
overflow: hidden;
border: 1px solid #aaa;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
user-select: none;
cursor: default;
}
.mod-input-increment .mod-ii-neg, .mod-input-increment .mod-ii-pos, .mod-input-increment .mod-ii-neg.locked:active, .mod-input-increment .mod-ii-pos.locked:active {
width: 35px;
height: 25px;
padding-top: 0;
float: left;
display: inline-block;
-webkit-box-shadow: 0 1px 0 0 rgba(255, 255, 255, .7) inset;
-moz-box-shadow: 0 1px 0 0 rgba(255, 255, 255, .7) inset;
box-shadow: 0 1px 0 0 rgba(255, 255, 255, .7) inset;
background-color: #d5d5d5;
background-image: -webkit-gradient(linear, left top, left bottom, from(#d5d5d5), to(#f6f6f6)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #d5d5d5, #f6f6f6); /* Chrome 10+, Saf5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, #d5d5d5, #f6f6f6); /* FF3.6 */
background-image: -ms-linear-gradient(top, #d5d5d5, #f6f6f6); /* IE10 */
background-image: -o-linear-gradient(top, #d5d5d5, #f6f6f6); /* Opera 11.10+ */
background-image: linear-gradient(to bottom, #d5d5d5, #f6f6f6);
color: #656c73;
font-weight: bold;
font-size: 20px;
line-height: 25px;
text-align: center;
text-shadow: 0 1px 0 rgba(255, 255, 255, 1);
cursor: pointer;
}
.mod-input-increment .mod-ii-neg:active, .mod-input-increment .mod-ii-pos:active {
height: 24px;
padding-top: 1px;
-webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .4) inset;
-moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .4) inset;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .4) inset;
background-color: #9b9b9b;
background-image: -webkit-gradient(linear, left top, left bottom, from(#9b9b9b), to(#f5f5f5)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient(top, #9b9b9b, #f5f5f5); /* Chrome 10+, Saf5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, #9b9b9b, #f5f5f5); /* FF3.6 */
background-image: -ms-linear-gradient(top, #9b9b9b, #f5f5f5); /* IE10 */
background-image: -o-linear-gradient(top, #9b9b9b, #f5f5f5); /* Opera 11.10+ */
background-image: linear-gradient(to bottom, #9b9b9b, #f5f5f5);
}
.mod-input-increment .mod-ii-neg.locked, .mod-input-increment .mod-ii-pos.locked, .mod-input-increment .mod-ii-neg.locked:active, .mod-input-increment .mod-ii-pos.locked:active {
color: #aaa;
}
.mod-input-increment .mod-ii-fakeinput {
width: 48px;
height: 23px;
display: inline-block;
float: left;
border: 1px solid #eee;
-webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .3) inset;
-moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .3) inset;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .3) inset;
color: #555;
font-weight: bold;
font-size: 18px;
line-height: 23px;
text-align: center;
text-shadow: 0 1px 0 rgba(255, 255, 255, 1);
background: #d9d9d9;
outline: none;
}
.mod-input-increment input {
display: none;
}
</style>
<script type="text/javascript" src="js/zepto.min.js"></script>
<script type="text/javascript" src="js/onpress.js"></script>
<script type="text/javascript" src="js/inputincrement.js"></script>
<script type="text/javascript">
Zepto(function($){
$('.mod-input-increment').mod_inputIncrement();
});
</script>
</head>
<body>
<div id="main">
<label>Number</label>
<span class="mod-input-increment" data-min="0" data-max="10" data-step="1">
<span class="mod-ii-neg">−</span>
<ins class="mod-ii-fakeinput">5</ins>
<span class="mod-ii-pos">+</span>
<input type="hidden" name="myrealinput" value="5">
</span>
</div>
</body>
</html>