"Product Selector Checkbox Buttons "
Bootstrap 3.0.3 Snippet by skauch

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/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="product-selector container " > <div class="row"> <div class="col-md-6 col-md-offset-3"> <form class="form-horizontal " role="form"> <div class="row"> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="left-item" class="hidden"> </div> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="middle-item" class="hidden"> </div> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="right-item" class="hidden"> </div> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="right-item" class="hidden"> </div> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="right-item" class="hidden"> </div> <div class="col-xs-2"> <img src="http://placehold.it/50x50" class="img-responsive img-radio"> <button type="button" class="btn btn-primary btn-xs btn-radio">Seleccionar</button> <input type="checkbox" id="right-item" class="hidden"> </div> </div> </form> </div> </div> </div>
.btn-radio { width: 100%; } .img-radio { opacity: 0.5; margin-bottom: 5px; padding:5px; } .space-20 { margin-top: 10px; } .product-selector button{ font-size:10px; }
$(function () { $('.btn-radio').click(function(e) { $('.btn-radio').not(this).removeClass('active') .siblings('input').prop('checked',false) .siblings('.img-radio').css('opacity','0.5'); $(this).addClass('active') .siblings('input').prop('checked',true) .siblings('.img-radio').css('opacity','1'); }); });

Related: See More


Questions / Comments: