forked from acidb/mobiscroll
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
146 lines (125 loc) · 5.75 KB
/
demo.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
<!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">
<meta name="description" content="Mobiscroll is a scroller style date/time picker optimized for touch devices such as iPhone, iPad, Android, to easily enter date and/or time. It's easily customizable and comes with very nice pre-defined themes: iOS, Android, Sense UI, Default."/>
<meta name="keywords" content="jQuery, JavaScript, datepicker, timepicker, touchscreen, Webkit, android, iPhone, iPad, webapps, GalaxyTab, dropdown, mobile, wheel, senseui, wheel, barrel, scroller-style, clickpick"/>
<title>Mobiscroll</title>
<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script>
<script src="js/mobiscroll-1.5.2.js" type="text/javascript"></script>
<link href="css/mobiscroll-1.5.2.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
font-family: arial, verdana, sans-serif;
font-size: 12px;
}
.dww img {
width: 30px;
height: 30px;
margin: 5px 30px;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
// Date with external button
$('#date1').scroller();
// Time
$('#date2').scroller({ preset: 'time' });
// Datetime
$('#date3').scroller({ preset: 'datetime' });
var group = {};
var wheels = [group];
for (var i = 1; i < 4; i++) {
var wheel = {};
for (var j = 0; j < 100; j++) {
wheel[j] = '<img src="img/fruit-' + (j % 5 + 1) + '.png" />'
}
group['Fruit ' + i] = wheel;
}
$('#custom').scroller({
width: 90,
wheels: wheels
});
$('#disable').click(function() {
$('#date1').scroller('disable');
return false;
});
$('#enable').click(function() {
$('#date1').scroller('enable');
return false;
});
$('#get').click(function() {
alert($('#date1').scroller('getDate'));
return false;
});
$('#set').click(function() {
$('#date1').scroller('setDate', new Date(), true);
return false;
});
$('#theme, #mode').change(function() {
var t = $('#theme').val();
var m = $('#mode').val();
$('#date1').scroller('destroy').scroller({ theme: t, mode: m });
$('#date2').scroller('destroy').scroller({ preset: 'time', theme: t, mode: m });
$('#date3').scroller('destroy').scroller({ preset: 'datetime', theme: t, mode: m });
$('#custom').scroller('option', { theme: t, mode: m });
});
});
</script>
</head>
<body>
<div data-role="page" data-theme="b" id="jqm-home">
<div data-role="header" data-theme="a">
<h1>Mobiscroll</h1>
</div>
<div data-role="content" data-theme="d">
<form id="testform">
<div data-role="fieldcontain">
<label for="theme">Theme</label>
<select name="theme" id="theme" data-native-menu="false">
<option value="default">Default</option>
<option value="android">Android</option>
<option value="sense-ui">Sense UI</option>
<option value="ios">iOS</option>
</select>
</div>
<div data-role="fieldcontain">
<label for="mode">Mode</label>
<select name="mode" id="mode" data-native-menu="false">
<option value="scroller">Scroller</option>
<option value="clickpick">Clickpick</option>
</select>
</div>
<div data-role="fieldcontain">
<label for="date1">Date</label>
<input type="text" name="date1" id="date1" class="mobiscroll" value="01.01.2011" />
</div>
<div data-role="controlgroup" data-type="horizontal">
<button id="disable" data-theme="a">Disable</button>
<button id="enable" data-theme="a">Enable</button>
</div>
<div data-role="controlgroup" data-type="horizontal">
<button id="get" data-theme="a">Get</button>
<button id="set" data-theme="a">Set</button>
</div>
<div data-role="fieldcontain">
<label for="date2">Time</label>
<input type="text" name="date2" id="date2" class="mobiscroll" readonly="readonly" value="11:23 AM" />
</div>
<div data-role="fieldcontain">
<label for="date3">Datetime</label>
<input type="text" name="date3" id="date3" class="mobiscroll" />
</div>
<div data-role="fieldcontain">
<label for="custom">Custom (Fruits :D)</label>
<input type="text" name="custom" id="custom" class="mobiscroll" value="1 0 1" />
</div>
</form>
</div>
</div>
</body>
</html>