Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Buying Selling Radio Buttons"
Bootstrap 3.3.0 Snippet by
jailix
3.3.0
jQuery
buttons
radio
Preview
HTML
CSS
JS
View Full Screen
Forked from
Fork
Fork this
Parent
922
 
0 Fav
Post to Facebook
Tweet this
<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>
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76