This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
/
index.php
227 lines (193 loc) · 8.69 KB
/
index.php
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Flip Toggle Switch - jQuery Mobile Demos</title>
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
<link rel="stylesheet" href="../../css/themes/default/jquery.mobile.css">
<link rel="stylesheet" href="../_assets/css/jqm-demos.css">
<script src="../../external/jquery/jquery.js"></script>
<script src="../_assets/js/"></script>
<script src="../../js/"></script>
<style id="custom-label-flipswitch">
/* Custom indentations are needed because the length of custom labels differs from
the length of the standard labels */
.custom-label-flipswitch.ui-flipswitch .ui-btn.ui-flipswitch-on {
text-indent: -3.4em;
}
.custom-label-flipswitch.ui-flipswitch .ui-flipswitch-off {
text-indent: 0.5em;
}
</style>
<style id="custom-size-flipswitch">
/* Custom indentations are needed because the length of custom labels differs from
the length of the standard labels */
.custom-size-flipswitch.ui-flipswitch .ui-btn.ui-flipswitch-on {
text-indent: -5.9em;
}
.custom-size-flipswitch.ui-flipswitch .ui-flipswitch-off {
text-indent: 0.5em;
}
/* Custom widths are needed because the length of custom labels differs from
the length of the standard labels */
.custom-size-flipswitch.ui-flipswitch {
width: 8.875em;
}
.custom-size-flipswitch.ui-flipswitch.ui-flipswitch-active {
padding-left: 7em;
width: 1.875em;
}
@media (min-width: 28em) {
// Repeated from rule .ui-flipswitch above
.ui-field-contain > label + .custom-size-flipswitch.ui-flipswitch {
width: 1.875em;
}
}
</style>
</head>
<body>
<div data-role="page" class="jqm-demos" data-quicklinks="true">
<div data-role="header" class="jqm-header">
<h2><a href="../" title="jQuery Mobile Demos home"><img src="../_assets/img/jquery-logo.png" alt="jQuery Mobile"></a></h2>
<p><span class="jqm-version"></span> Demos</p>
<a href="#" class="jqm-navmenu-link ui-btn ui-btn-icon-notext ui-corner-all ui-icon-bars ui-nodisc-icon ui-alt-icon ui-btn-left">Menu</a>
<a href="#" class="jqm-search-link ui-btn ui-btn-icon-notext ui-corner-all ui-icon-search ui-nodisc-icon ui-alt-icon ui-btn-right">Search</a>
</div><!-- /header -->
<div role="main" class="ui-content jqm-content">
<h1>Flip switch</h1>
<p>Flip switches are used for boolean style inputs like true/false or on/off in a compact UI element.
</p>
<h2>Basic checkbox switch</h2>
<div data-demo-html="true">
<form>
<label for="flip-checkbox-1">Flip toggle switch checkbox:</label>
<input type="checkbox" data-role="flipswitch" name="flip-checkbox-1" id="flip-checkbox-1">
</form>
</div><!-- /demo-html -->
<h2>Basic checkbox switch with custom labels</h2>
<div data-demo-html="true" data-demo-css="#custom-label-flipswitch">
<form>
<label for="flip-checkbox-2">Flip toggle switch checkbox:</label>
<input type="checkbox" data-role="flipswitch" name="flip-checkbox-2" id="flip-checkbox-2" data-on-text="Light" data-off-text="Dark" data-wrapper-class="custom-label-flipswitch">
</form>
</div><!-- /demo-html -->
<h2>Basic checkbox switch with custom labels and custom size</h2>
<div data-demo-html="true" data-demo-css="#custom-size-flipswitch">
<form>
<label for="flip-checkbox-3">Flip toggle switch checkbox:</label>
<input type="checkbox" data-role="flipswitch" name="flip-checkbox-3" id="flip-checkbox-3" data-on-text="Assured" data-off-text="Uncertain" data-wrapper-class="custom-size-flipswitch">
</form>
</div><!-- /demo-html -->
<h2>Basic checkbox switch checked</h2>
<div data-demo-html="true">
<form>
<label for="flip-checkbox-4">Flip toggle switch checkbox:</label>
<input type="checkbox" data-role="flipswitch" name="flip-checkbox-4" id="flip-checkbox-4" checked>
</form>
</div><!-- /demo-html -->
<h2>Basic select switch</h2>
<div data-demo-html="true">
<form>
<label for="flip-select">Flip toggle switch select:</label>
<select id="flip-select" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option>On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Basic select switch second option selected</h2>
<div data-demo-html="true">
<form>
<label for="flip-select-second">Flip toggle switch select:</label>
<select id="flip-select-second" name="flip-select" data-role="flipswitch">
<option>Off</option>
<option selected>On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Theme</h2>
<div data-demo-html="true">
<form>
<label for="flip-2">Flip toggle switch:</label>
<select name="flip-2" id="flip-2" data-role="flipswitch" data-theme="b">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Mini</h2>
<div data-demo-html="true">
<form>
<label for="flip-3">Flip toggle switch:</label>
<select name="flip-3" id="flip-3" data-role="flipswitch" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>No corners</h2>
<div data-demo-html="true">
<form>
<label for="flip-8">Flip toggle switch:</label>
<select name="flip-8" id="flip-8" data-role="flipswitch" data-corners="false">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Disabled</h2>
<div data-demo-html="true">
<form>
<label for="flip-4">Flip toggle switch:</label>
<select name="flip-4" id="flip-4" data-role="flipswitch" disabled="disabled">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Label hidden</h2>
<div data-demo-html="true">
<form>
<label for="flip-5" class="ui-hidden-accessible">Flip toggle switch:</label>
<select name="flip-5" id="flip-5" data-role="flipswitch">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</form>
</div><!-- /demo-html -->
<h2>Fieldcontain</h2>
<div data-demo-html="true">
<form>
<div class="ui-field-contain">
<label for="flip-6">Flip toggle switch:</label>
<select name="flip-6" id="flip-6" data-role="flipswitch">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</div>
</form>
</div><!-- /demo-html -->
<h2>Fieldcontain, mini</h2>
<div data-demo-html="true">
<form>
<div class="ui-field-contain">
<label for="flip-7">Flip toggle switch:</label>
<select name="flip-7" id="flip-7" data-role="flipswitch" data-mini="true">
<option value="off">Off</option>
<option value="on">On</option>
</select>
</div>
</form>
</div><!-- /demo-html -->
</div><!-- /content -->
<?php include( '../jqm-navmenu.php' ); ?>
<div data-role="footer" data-position="fixed" data-tap-toggle="false" class="jqm-footer">
<p>jQuery Mobile Demos version <span class="jqm-version"></span></p>
<p>Copyright 2014 The jQuery Foundation</p>
</div><!-- /footer -->
<?php include( '../jqm-search.php' ); ?>
</div><!-- /page -->
</body>
</html>