"Switch Toggle"
Bootstrap 3.0.0 Snippet by naimansari

<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>
.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; } .onoffswitch3-switch { display: block; width: 50%; margin: 0px; text-align: center; border: 0px solid #999999;border-radius: 0px; position: absolute; top: 0; bottom: 0; } .onoffswitch3-active .onoffswitch3-switch { background: #27A1CA; left: 0; } .onoffswitch3-inactive .onoffswitch3-switch { background: #A1A1A1; right: 0; } .onoffswitch3-checkbox:checked + .onoffswitch3-label .onoffswitch3-inner { margin-left: 0; }

Related: See More


Questions / Comments: