"Buying Selling Radio Buttons"
Bootstrap 3.3.0 Snippet by jailix

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.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="container"> <h3>Tipo de </h3> <div class="buying-selling-group" id="buying-selling-group" data-toggle="buttons"> <label class="btn btn-default buying-selling alta"> <input type="radio" name="options" value="1" autocomplete="off"> <span class="radio-dot"></span> <span class="buying-selling-word">REPARAR</span> </label> <label class="btn btn-default buying-selling baja"> <input type="radio" name="options" value="2" autocomplete="off"> <span class="radio-dot"></span> <span class="buying-selling-word">BAJA</span> </label> </div> </div>
.buying-selling.alta.active { background: #ffc41e; } .buying-selling.baja.active { background: red; } #buying-selling-group{ display: inline-block !important; } .buying-selling { width: 130px; padding: 10px; position: relative; } .buying-selling-word { font-size: 15px; font-weight: 600; margin-left: 22px; } .radio-dot:before, .radio-dot:after { content: ""; display: block; position: absolute; background: #fff; border-radius: 100%; } .radio-dot:before { width: 20px; height: 20px; border: 1px solid #ccc; top: 10px; left: 16px; } .radio-dot:after { width: 12px; height: 12px; border-radius: 100%; top: 14px; left: 20px; } .buying-selling:hover .radio-dot:before { border-color: #adadad; } .buying-selling:hover .radio-dot:after { background: #e6e6e6; } .buying-selling.active .buying-selling-word { color: #fff; } .buying-selling.alta.active .radio-dot:after { background: #ffc41e; } .buying-selling.alta.active .radio-dot:before { background: #fff; border-color: #ffc41e; } .buying-selling.alta.active:hover .radio-dot:before { border-color: #ffc41e; } .buying-selling.alta.active .radio-dot:after { background: #ca9600; } .buying-selling.alta.active:hover .radio-dot:after { background: #ca9600; } .buying-selling.baja.active .radio-dot:after { background: red; } .buying-selling.baja.active .radio-dot:before { background: #fff; border-color: red; } .buying-selling.baja.active:hover .radio-dot:before { border-color: red; } .buying-selling.baja.active .radio-dot:after { background: #bf0000; } .buying-selling.baja.active:hover .radio-dot:after { background: #bf0000; } @media (max-width: 400px) { .mobile-br { display: none; } .buying-selling { width: 49%; padding: 10px; position: relative; } }
$(window).resize(function() { if ($(window).width() <= 600) { $('#prop-type-group').removeClass('btn-group'); $('#prop-type-group').addClass('btn-group-vertical'); } else { $('#prop-type-group').addClass('btn-group'); $('#prop-type-group').removeClass('btn-group-vertical'); } }); <script> $(function() { $("input:radio[name='options']").change(function() { alert("cosa"); }); }); </script>

Related: See More


Questions / Comments: