forked from Bttstrp/bootstrap-switch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options.html
248 lines (248 loc) · 9.48 KB
/
options.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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Options</h1>
</div>
</div>
<div class="container">
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Attribute</th>
<th>Type</th>
<th>Description</th>
<th>Values</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>checked</td>
<td>Boolean</td>
<td>The checkbox state</td>
<td>true, false</td>
<td>true</td>
</tr>
<tr>
<td>size</td>
<td>data-size</td>
<td>String</td>
<td>The checkbox size</td>
<td>null, 'mini', 'small', 'normal', 'large'</td>
<td>null</td>
</tr>
<tr>
<td>animate</td>
<td>data-animate</td>
<td>Boolean</td>
<td>Animate the switch</td>
<td>true, false</td>
<td>true</td>
</tr>
<tr>
<td>disabled</td>
<td>disabled</td>
<td>Boolean</td>
<td>Disable state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>readonly</td>
<td>readonly</td>
<td>Boolean</td>
<td>Readonly state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>indeterminate</td>
<td>data-indeterminate</td>
<td>Boolean</td>
<td>Indeterminate state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>inverse</td>
<td>data-inverse</td>
<td>Boolean</td>
<td>Inverse switch direction</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>radioAllOff</td>
<td>data-radio-all-off</td>
<td>Boolean</td>
<td>Allow this radio button to be unchecked by the user</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>onColor</td>
<td>data-on-color</td>
<td>String</td>
<td>Color of the left side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>'primary'</td>
</tr>
<tr>
<td>offColor</td>
<td>data-off-color</td>
<td>String</td>
<td>Color of the right side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>'default'</td>
</tr>
<tr>
<td>onText</td>
<td>data-on-text</td>
<td>String</td>
<td>Text of the left side of the switch</td>
<td>String</td>
<td>'ON'</td>
</tr>
<tr>
<td>offText</td>
<td>data-off-text</td>
<td>String</td>
<td>Text of the right side of the switch</td>
<td>String</td>
<td>'OFF'</td>
</tr>
<tr>
<td>labelText</td>
<td>data-label-text</td>
<td>String</td>
<td>Text of the center handle of the switch</td>
<td>String</td>
<td>'&nbsp;'</td>
</tr>
<tr>
<td>handleWidth</td>
<td>data-handle-width</td>
<td>String | Number</td>
<td>Width of the left and right sides in pixels</td>
<td>'auto' or Number</td>
<td>'auto'</td>
</tr>
<tr>
<td>labelWidth</td>
<td>data-label-width</td>
<td>String | Number</td>
<td>Width of the center handle in pixels</td>
<td>'auto' or Number</td>
<td>'auto'</td>
</tr>
<tr>
<td>baseClass</td>
<td>data-base-class</td>
<td>String</td>
<td>Global class prefix</td>
<td>String</td>
<td>'bootstrap-switch'</td>
</tr>
<tr>
<td>wrapperClass</td>
<td>data-wrapper-class</td>
<td>String | Array</td>
<td>Container element class(es)</td>
<td>String | Array</td>
<td>'wrapper'</td>
</tr>
<tr>
<td>onInit</td>
<td></td>
<td>Function</td>
<td>Callback function to execute on initialization</td>
<td>Function</td>
<td>
<pre><code class="javascript">function(event, state) {}</code></pre>
</td>
</tr>
<tr>
<td>onSwitchChange</td>
<td></td>
<td>Function</td>
<td>Callback function to execute on switch state change</td>
<td>Function</td>
<td>
<pre><code class="javascript">function(event, state) {}</code></pre>
</td>
</tr>
</tbody>
</table>
<h2>Global Defaults Overriding</h2>
<p>Follow the jQuery convention to override the default options of the library. For instance:</p>
<pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
$.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>