-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsample.html
More file actions
95 lines (78 loc) · 1.99 KB
/
sample.html
File metadata and controls
95 lines (78 loc) · 1.99 KB
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
<!DOCTYPE html>
<html lang='en'>
<head>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<p>
Default:<br/>
<input type='checkbox' name='checkbox1' />
</p>
<p>
Event change:<br/>
<input type='checkbox' name='checkbox2' checked />
</p>
<p>
Different classes:<br/>
<input type='checkbox' name='checkbox3' />
</p>
<p>
Label Text:<br/>
<input type='checkbox' name='checkbox4' />
</p>
<p>
Same lables/text:<br/>
<input type='checkbox' name='checkbox5' />
</p>
<p>
Disabled:<br/>
<input type='checkbox' name='checkbox10' disabled />
</p>
<p>
Sizes (xs, sm, md, lg):<br/>
<input type='checkbox' name='checkbox6' />
<input type='checkbox' name='checkbox7' />
<input type='checkbox' name='checkbox8' />
<input type='checkbox' name='checkbox9' />
</p>
</div>
<script src="bootstrap-switch.js" ></script>
<script>
// Remember set you events before call bootstrapSwitch or they will fire after bootstrapSwitch's events
$("[name='checkbox2']").change(function() {
if(!confirm('Do you wanna cancel me!')) {
this.checked = true;
}
});
$("[name='checkbox1'],[name='checkbox2'], [name='checkbox10']").bootstrapSwitch();
$("[name='checkbox3']").bootstrapSwitch({
on: 'Enabled',
off: 'Disabled',
onClass: 'success',
offClass: 'warning'
});
$("[name='checkbox4']").bootstrapSwitch({
onLabel: 'closed',
offLabel: 'open'
});
$("[name='checkbox5']").bootstrapSwitch({
same: true
});
$("[name='checkbox6']").bootstrapSwitch({
size: 'xs'
});
$("[name='checkbox7']").bootstrapSwitch({
size: 'sm'
});
$("[name='checkbox8']").bootstrapSwitch({
size: 'md'//default
});
$("[name='checkbox9']").bootstrapSwitch({
size: 'lg'
});
</script>
</body>
</html>