<div class="wrap">
<div class="wrap">
<div class="radio-group">
<input id="opt_1" class="radio-group__option" type="radio" name="opt" checked="checked">
<label class="radio-group__label" for="opt_1">
Everyone
</label>
<input id="opt_2" class="radio-group__option" type="radio" name="opt">
<label class="radio-group__label" for="opt_2">
Just for me
</label>
</div>
<br/>
<div class="log">
Hello log.
</div>
</div>
<script class="cssdeck" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
$toggle-inactive- color: #4F5167;
$toggle-inactive-color: #4F5167;
$toggle-active-color: #389E29;
$trans-duration-base: 250ms;
body {
background: #2A2A34;
width: 250px;
height: 28px;
margin: 20px 20px 20px -125px;
overflow: hidden;
position: absolute;
left: 50%;
top: 20%;
}
.log {
color: #DDD;
margin-top: 20%;
padding: 0 5px;
opacity: .3;
transition: all 250ms;
text-align: center;
display: none;
}
.radio-group {
width: 250px;
display: table;
table-layout: fixed;
border-spacing: 0;
border-collapse: separate;
}
.radio-group__label {
display: table-cell;
height: 28px;
padding: 5px;
vertical-align: middle;
text-align: center;
position: relative;
border: 1px solid $toggle-inactive-color;
border-style: solid none solid solid;
border-radius: 5px 0 0 5px;
color: $toggle-inactive-color;
transition(border $trans-duration-base, color $trans-duration-base);
}
.radio-group__label + input + .radio-group__label {
border-radius: 0 5px 5px 0;
border-style: solid solid solid none;
}
.radio-group__label + input + .radio-group__label:before {
content: " ";
display: block;
position: absolute;
top:-1px;
width: 100%;
height: 100%;
border: 1px solid $toggle-active-color;
border-radius: 5px 0 0 5px;
transform: translate3d(-103%,0,0);
transition: all $trans-duration-base;
}
.radio-group__label + input:checked + .radio-group__label:before {
border-radius: 0 5px 5px 0;
transform: translate3d(-6px,0,0);
}
.radio-group__option:checked + label {
color: $toggle-active-color;
}
.radio-group__option {
display: none;
}
function updateLog() {
function updateLog() {
var one = $("#opt_1:checked").val() ? "On" : "Off"
var two = $("#opt_2:checked").val() ? "On" : "Off"
$(".log").html("Everyone: " + one + "<br/>Just for me: " + two)
}
$(".radio-group__option").change(updateLog)