"Switch Toggle"
Bootstrap 3.0.0 Snippet by naimansari

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="onoffswitch3">
<input type="checkbox" name="onoffswitch3" class="onoffswitch3-checkbox" id="myonoffswitch3" checked>
<label class="onoffswitch3-label" for="myonoffswitch3">
<span class="onoffswitch3-inner">
<span class="onoffswitch3-active"><span class="onoffswitch3-switch">Active</span></span>
<span class="onoffswitch3-inactive"><span class="onoffswitch3-switch">Inactive</span></span>
</span>
</label>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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
.onoffswitch3
{
position: relative; width: 200px;
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;
}
.onoffswitch3-checkbox {
display: none;
}
.onoffswitch3-label {
display: block; overflow: hidden; cursor: pointer;
border: 0px solid #999999; border-radius: 0px;
}
.onoffswitch3-inner {
display: block; width: 200%; margin-left: -100%;
-moz-transition: margin 0.3s ease-in 0s; -webkit-transition: margin 0.3s ease-in 0s;
-o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s;
}
.onoffswitch3-inner > span {
display: block; float: left; position: relative; width: 50%; height: 30px; padding: 0; line-height: 30px;
font-size: 14px; color: white; font-family: Trebuchet, Arial, sans-serif; font-weight: bold;
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.onoffswitch3-inner .onoffswitch3-active {
padding-left: 10px;
background-color: #EEEEEE; color: #FFFFFF;
}
.onoffswitch3-inner .onoffswitch3-inactive {
padding-right: 10px;
background-color: #EEEEEE; color: #FFFFFF;
text-align: right;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: