"Single Button Toggle"
Bootstrap 3.3.0 Snippet by tonetlds

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <div class="container"> <h1 class="text-center">Toggle!</h1> </div> <div class="container"> <div class="well well-sm text-center"> <div class="" data-toggle="buttons"> <label class="btn btn-lg btn-success active"> <input type="radio" name="options" id="option1" autocomplete="off" checked> <i class="fa fa-check"></i> Pago </label> <label class="btn btn-lg btn-danger"> <input type="radio" name="options" id="option2" autocomplete="off"> <i class="fa fa-warning"></i> Não pago </label> </div> <br /> <div class="" data-toggle="buttons"> <label class="btn btn-lg btn-default active"> <input type="radio" name="options" id="option1" autocomplete="off" checked> <i class="fa fa-thumbs-o-up"></i> </label> <label class="btn btn-lg btn-default"> <input type="radio" name="options" id="option2" autocomplete="off"> <i class="fa fa-thumbs-o-down"></i> </label> </div> <br /> <div class="" data-toggle="buttons"> <label class="btn btn-lg btn-block btn-success text-success active"> <input type="radio" name="options" id="option1" autocomplete="off" checked> <i class="fa fa-check-circle-o fa-3x animated fadeIn"></i> <br /> Pago </label> <label class="btn btn-lg btn-block btn-default text-default"> <input type="radio" name="options" id="option2" autocomplete="off"> <i class="fa fa-circle-o fa-3x"></i> <br /> Não pago </label> </div> </div> </div> </div>
.btn.active { display: none; } .btn span:nth-of-type(1) { display: none; } .btn span:last-child { display: block; } .btn.active span:nth-of-type(1) { display: block; } .btn.active span:last-child { display: none; }

Similar snippets: See More


Comments:

comments powered by Disqus