4
4
< title > Toggle Switch - by @jamiebicknell - Github</ title >
5
5
< meta http-equiv ='Content-Type ' content ='text/html;charset=utf-8 ' />
6
6
< meta name ='viewport ' content ='initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no ' />
7
- < link href ='./toggle-switch .css ' rel ='stylesheet ' type ='text/css ' />
7
+ < link href ='./toggleswitch .css ' rel ='stylesheet ' type ='text/css ' />
8
8
<!--[if lt IE 8]>
9
- <link href='./toggle-switch .ie.css' rel='stylesheet' type='text/css' />
9
+ <link href='./toggleswitch .ie.css' rel='stylesheet' type='text/css' />
10
10
<![endif]-->
11
11
< style type ='text/css '>
12
12
body {
22
22
margin : 0 0 6px 0 ;
23
23
height : 16px ;
24
24
}
25
- .wrapper .row label . switch-label {
25
+ .wrapper .row label {
26
26
float : left;
27
27
width : 100px ;
28
28
}
35
35
36
36
< div class ='wrapper '>
37
37
< div class ='row '>
38
- < label for ='opt1 ' class ='switch-label '> Option 1</ label >
39
- < div class ='switch '>
40
- < div class ='overlay '> </ div >
41
- < span class ='switched '> </ span >
42
- < input type ='checkbox ' name ='opt1 ' id ='opt1 ' value ='1 ' checked ='checked ' />
43
- </ div >
38
+ < label for ='opt1 '> Option 1</ label >
39
+ < input type ='checkbox ' name ='opt1 ' id ='opt1 ' value ='1 ' class ='toggleswitch ' checked ='checked ' />
44
40
</ div >
45
41
< div class ='row '>
46
- < label for ='opt2 ' class ='switch-label '> Option 2</ label >
47
- < div class ='switch '>
48
- < div class ='overlay '> </ div >
49
- < span class ='switched off '> </ span >
50
- < input type ='checkbox ' name ='opt2 ' id ='opt2 ' value ='1 ' />
51
- </ div >
42
+ < label for ='opt2 '> Option 2</ label >
43
+ < input type ='checkbox ' name ='opt2 ' id ='opt2 ' value ='1 ' class ='toggleswitch ' />
52
44
</ div >
53
45
< div class ='row '>
54
- < label for ='opt3 ' class ='switch-label '> Option 3</ label >
55
- < div class ='switch '>
56
- < div class ='overlay '> </ div >
57
- < span class ='switched off '> </ span >
58
- < input type ='checkbox ' name ='opt3 ' id ='opt3 ' value ='1 ' />
59
- </ div >
46
+ < label for ='opt3 '> Option 3</ label >
47
+ < input type ='checkbox ' name ='opt3 ' id ='opt3 ' value ='1 ' class ='toggleswitch ' />
60
48
</ div >
61
49
< div class ='row '>
62
- < label for ='opt4 ' class ='switch-label '> Option 4</ label >
50
+ < label for ='opt4 '> Option 4</ label >
51
+ < input type ='checkbox ' name ='opt4 ' id ='opt4 ' value ='1 ' class ='toggleswitch ' checked ='checked ' />
52
+ </ div >
53
+ < div class ='row '>
54
+ < label for ='opt5 '> Option 5</ label >
63
55
< div class ='switch '>
64
56
< div class ='overlay '> </ div >
65
57
< span class ='switched '> </ span >
66
- < input type ='checkbox ' name ='opt4 ' id ='opt4 ' value ='1 ' checked ='checked ' />
58
+ < input type ='checkbox ' name ='opt5 ' id ='opt5 ' value ='1 ' class =' toggleswitch ' checked ='checked ' />
67
59
</ div >
68
60
</ div >
69
61
< div class ='row '>
70
- < label for ='opt5 ' class =' switch-label ' > Option 5 </ label >
62
+ < label for ='opt6 ' > Option 6 </ label >
71
63
< div class ='switch '>
72
64
< div class ='overlay '> </ div >
73
- < span class ='switched '> </ span >
74
- < input type ='checkbox ' name ='opt5 ' id ='opt5 ' value ='1 ' checked =' checked ' />
65
+ < span class ='switched off '> </ span >
66
+ < input type ='checkbox ' name ='opt6 ' id ='opt6 ' value ='1 ' class =' toggleswitch ' />
75
67
</ div >
76
68
</ div >
77
69
</ div >
78
70
79
- < script type ='text/javascript ' src ='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js '> </ script >
80
- < script type ='text/javascript ' src ='./toggle-switch.js '> </ script >
71
+ < script type ='text/javascript ' src ='http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js '> </ script >
72
+ < script type ='text/javascript ' src ='./jquery.toggleswitch.js '> </ script >
73
+ < script type ='text/javascript '>
74
+ jQuery ( document ) . ready ( function ( $ ) {
75
+ $ ( '.toggleswitch' ) . toggleSwitch ( ) ;
76
+ } ) ;
77
+ </ script >
81
78
82
79
</ body >
83
80
</ html >
0 commit comments