-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-zepto.html
189 lines (177 loc) · 7.16 KB
/
demo-zepto.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>Mobiscroll</title>
<script src="http://zeptojs.com/zepto.js"></script>
<script src="js/mobiscroll.zepto.js" type="text/javascript"></script>
<script src="js/mobiscroll.core.js" type="text/javascript"></script>
<script src="js/mobiscroll.datetime.js" type="text/javascript"></script>
<script src="js/mobiscroll.select.js" type="text/javascript"></script>
<script src="js/mobiscroll.ios.js" type="text/javascript"></script>
<script src="js/mobiscroll.android.js" type="text/javascript"></script>
<script src="js/mobiscroll.android-ics.js" type="text/javascript"></script>
<link href="css/mobiscroll.core.css" rel="stylesheet" type="text/css" />
<link href="css/mobiscroll.android.css" rel="stylesheet" type="text/css" />
<link href="css/mobiscroll.android-ics.css" rel="stylesheet" type="text/css" />
<link href="css/mobiscroll.ios.css" rel="stylesheet" type="text/css" />
<link href="css/mobiscroll.sense-ui.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
font-family: arial, verdana, sans-serif;
font-size: 12px;
padding: 0;
margin: 0;
background: #F3F3F3;
}
.text-input {
width: 100%;
padding: 5px;
margin: 5px 0;
border: 1px solid #aaa;
box-shadow: inset 0 1px 4px rgba(0,0,0,.2);
border-radius: 5px;
-webkit-box-shadow: inset 0 1px 4px rgba(0,0,0,.2);
-webkit-border-radius: 5px;
}
.header {
border: 1px solid #333;
background: #111;
color: white;
font-weight: bold;
text-shadow: 0 -1px 1px black;
background-image: -webkit-gradient(linear,left top,left bottom,from(#3C3C3C),to(#111));
background-image: -webkit-linear-gradient(#3C3C3C,#111);
background-image: -moz-linear-gradient(#3C3C3C,#111);
background-image: -ms-linear-gradient(#3C3C3C,#111);
background-image: -o-linear-gradient(#3C3C3C,#111);
background-image: linear-gradient(#3C3C3C,#111);
}
.header h1 {
text-align: center;
font-size: 16px;
margin: .6em 0;
padding: 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.content {
padding: 15px;
background: #fff;
}
.fieldcontain {
padding-right: 12px;
}
.inline > div {
text-align: center;
}
#buttons {
text-align: left;
}
#buttons input {
margin: 0;
}
</style>
<script type="text/javascript">
$(function () {
var curr = new Date().getFullYear();
var opt = {
'date': {
preset: 'date',
dateOrder: 'mmddyy',
invalid: { daysOfWeek: [0, 6], daysOfMonth: ['5/1', '12/24', '12/25'] }
},
'datetime': {
preset: 'datetime',
minDate: new Date(2012, 3, 10, 9, 22),
maxDate: new Date(2014, 7, 30, 15, 44),
stepMinute: 5
},
'time': {
preset: 'time'
},
'credit': {
preset: 'date',
dateOrder: 'mmyy',
dateFormat: 'mm/yy',
startYear: curr,
endYear: curr + 10,
width: 100
},
'btn': {
preset: 'date',
showOnFocus: false
},
'inline': {
preset: 'date',
display: 'inline'
}
}
$('select').scroller({ preset: 'select', inputClass: 'text-input' }).on('change', function() {
$('#test').val('').scroller('destroy').scroller($.extend(opt[$('#demo').val()], { theme: $('#theme').val(), mode: $('#mode').val() }));
$('#demo').val() == 'btn' ? $('#buttons').show() : $('#buttons').hide();
});
$('#demo').trigger('change');
$('#trigger').click(function() {
$('#test').scroller('show');
return false;
});
$('#clear').click(function() {
$('#test').val('');
return false;
});
});
</script>
</head>
<body>
<div class="page">
<div class="header">
<h1>Mobiscroll</h1>
</div>
<div class="content">
<form id="testform">
<div class="fieldcontain">
<label for="theme">Theme</label>
<select name="theme" id="theme">
<option value="default">Default</option>
<option value="android-ics">Android ICS</option>
<option value="android-ics light">Android ICS Light</option>
<option value="android">Android</option>
<option value="sense-ui">Sense UI</option>
<option value="ios">iOS</option>
</select>
</div>
<div class="fieldcontain">
<label for="mode">Mode</label>
<select name="mode" id="mode">
<option value="scroller">Scroller</option>
<option value="clickpick">Clickpick</option>
<option value="mixed">Mixed</option>
</select>
</div>
<div class="fieldcontain">
<label for="demo">Demo</label>
<select name="demo" id="demo">
<option value="date" selected>Date</option>
<option value="datetime">Datetime</option>
<option value="time">Time</option>
<option value="credit">Credit card expiration</option>
<option value="btn">Show/Clear buttons</option>
<option value="inline">Inline</option>
</select>
</div>
<div class="fieldcontain inline">
<label for="test">Click here to try</label>
<input type="text" name="test" id="test" class="text-input" />
<div id="buttons">
<input type="submit" value="Choose Date" id="trigger" />
<input type="submit" value="Clear" id="clear" />
</div>
</div>
</form>
</div>
</div>
</body>
</html>