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
"Calcul de cotisation - futur"
Bootstrap 4.1.1 Snippet by
numero67
4.1.1
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
347
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="price-box"> <div class="row"> <div class="col-sm-6"> <form class="form-horizontal form-pricing" role="form"> <div class="price-slider"> <h4 class="great">Domicile</h4> <span>Vous habitez</span> <p></p> <div class="btn-group btn-group-justified btn-group-toggle" data-toggle="buttons"> <label class="btn btn-info active"> <input type="radio" name="options" id="Brumath" autocomplete="off" checked=""> Brumath </label> <label class="btn btn-info"> <input type="radio" name="options" id="Exterieur" autocomplete="off"> Extérieur </label> </div> </div> <div class="price-slider"> <h4 class="great">Eveil musical</h4> <span>Pour les enfants scolarisés en GS ou CP</span> <p></p> <div class="btn-group btn-group-justified btn-group-toggle" data-toggle="buttons"> <label class="btn btn-info active"> <input type="radio" name="options" id="eveil_0" autocomplete="off" checked=""> Aucun élève </label> <label class="btn btn-info"> <input type="radio" name="options" id="eveil_1" autocomplete="off"> Un élève </label> <label class="btn btn-info"> <input type="radio" name="options" id="eveil_2" autocomplete="off"> Deux élèves </label> </div> </div> <div class="price-slider"> <h4 class="great">Cursus</h4> <span>Cours instrumental individuel, formation musicale et pratique collective</span> <p></p> <div class="btn-group btn-group-justified btn-group-toggle" data-toggle="buttons"> <label class="btn btn-info active"> <input type="radio" name="options" id="cursus_0" autocomplete="off" checked=""> Aucun élève </label> <label class="btn btn-info"> <input type="radio" name="options" id="cursus_1" autocomplete="off"> Un élève </label> <label class="btn btn-info"> <input type="radio" name="options" id="cursus_2" autocomplete="off"> Deux élèves </label> <label class="btn btn-info"> <input type="radio" name="options" id="cursus_3" autocomplete="off"> Trois élèves </label> </div> </div> <div class="price-slider"> <h4 class="great">Adulte</h4> <span>À partir de 21 ans</span> <p></p> <div class="btn-group btn-group-justified btn-group-toggle" data-toggle="buttons"> <label class="btn btn-info active"> <input type="radio" name="options" id="adulte_0" autocomplete="off" checked=""> Aucun adulte </label> <label class="btn btn-info"> <input type="radio" name="options" id="adulte_1" autocomplete="off"> Un adulte </label> <label class="btn btn-info"> <input type="radio" name="options" id="adulte_2" autocomplete="off"> Deux adultes </label> </div> </div> </form></div> <div class="col-sm-6"> <div class="price-form"> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label for="amount_amirol" class="control-label">Annuel (€): </label> <span class="help-text">Montant à payer</span> </div> <div class="col-sm-6"> <input type="hidden" id="amount_amirol" class="form-control"> <input class="price lead" name="totalprice" type="text" id="total" disabled="disabled" style=""> </div> </div> </div> <div class="form-group"> <div class="row"> <div class="col-sm-6"> <label for="amount_amirol" class="control-label">Trimestriel (€): </label> <span class="help-text">Montant à payer</span> </div> <div class="col-sm-6"> <input type="hidden" id="amount_amirol" class="form-control"> <input class="price lead" name="totalprice4" type="text" id="trimestre" disabled="disabled" style=""> </div> </div> </div> <div style="margin-top:30px"></div> <hr class="style"> </div> </div> </div> </div> </div>
body { padding-top: 60px; } .price-box { margin: 0 auto; background: #E9E9E9; border-radius: 10px; padding: 40px 15px; /*width: 500px;*/ } .ui-widget-content { border: 1px solid #bdc3c7; background: #e1e1e1; color: #222222; margin-top: 4px; } .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 7.2em; height: 2.7em; cursor: default; margin: 0 -40px auto !important; text-align: center; line-height: 30px; color: #FFFFFF; font-size: 12px; } .ui-slider .ui-slider-handle .glyphicon { color: #FFFFFF; margin: 0 1px; font-size: 11px; opacity: 0.7; } .ui-corner-all { border-radius: 20px; } .ui-slider-horizontal .ui-slider-handle { top: -.9em; } .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #f9f9f9; background: #3498db; } .ui-slider-horizontal .ui-slider-handle { margin-left: -0.5em; } .ui-slider .ui-slider-handle { cursor: pointer; } .ui-slider a, .ui-slider a:focus { cursor: pointer; outline: none; } .price, .lead p { font-weight: 600; font-size: 32px; display: inline-block; line-height: 60px; border:0; width: 245px; } h4.great { background: #00ac98; margin: 0 0 25px -60px; padding: 7px 15px; color: #ffffff; font-size: 18px; font-weight: 600; border-radius: 5px; display: inline-block; -moz-box-shadow: 2px 4px 5px 0 #ccc; -webkit-box-shadow: 2px 4px 5px 0 #ccc; box-shadow: 2px 4px 5px 0 #ccc; } .total { border-bottom: 1px solid #7f8c8d; /*display: inline; padding: 10px 5px;*/ position: relative; padding-bottom: 20px; } .total:before { content: ""; display: inline; position: absolute; left: 0; bottom: 5px; width: 100%; height: 3px; background: #7f8c8d; opacity: 0.5; } .price-slider { margin-bottom: 70px; } .price-slider span { font-weight: 200; display: inline-block; color: #7f8c8d; font-size: 13px; } .form-pricing { background: #ffffff; padding: 20px; border-radius: 4px; } .price-form { background: #ffffff; margin-bottom: 10px; padding: 20px; border: 1px solid #eeeeee; min-height: 520px; border-radius: 4px; /*-moz-box-shadow: 0 5px 5px 0 #ccc; -webkit-box-shadow: 0 5px 5px 0 #ccc; box-shadow: 0 5px 5px 0 #ccc;*/ } .form-group { margin-bottom: 0; } .form-group span.price { font-weight: 200; display: inline-block; color: #7f8c8d; font-size: 14px; } .help-text { display: block; margin-top: -10px; margin-bottom: 10px; color: #737373; /*position: absolute;*/ /*margin-left: 20px;*/ font-weight: 200; /*text-align: right;*/ width: 188px; } .price-form label { font-weight: 200; font-size: 21px; } img.payment { display: block; margin-left: auto; margin-right: auto } .ui-slider-range-min { background: #2980b9; } .active-month, .active-term { background: #3276b1; } /* HR */ hr.style { margin-top: 0; border: 0; border-bottom: 1px dashed #ccc; background: #999; }
var fromBrumath = true; var nbEveil = 0; var nbCursus = 0; var nbAdulte = 0; $(document).ready(function () { $("#total").val("0"); $('.domicile').on('click', function (event) { fromBrumath = $(this).attr('id') === 'Brumath'; $('.domicile').removeClass('selected-domicile'); $(this).addClass('selected-domicile'); $(".domicile").removeClass("active-domicile"); $(this).addClass("active-domicile"); calcualtePrice() }); $('.eveil').on('click', function (event) { var id = $(this).attr('id'); nbEveil = 0; if (id === 'eveil_0') nbEveil = 0; else if (id === 'eveil_1') nbEveil = 1; else if (id === 'eveil_2') nbEveil = 2; $('.eveil').removeClass('selected-eveil'); $(this).addClass('selected-eveil'); $(".eveil").removeClass("active-eveil"); $(this).addClass("active-eveil"); calcualtePrice() }); $('.cursus').on('click', function (event) { var id = $(this).attr('id'); nbCursus = 0; if (id === 'cursus_0') nbCursus = 0; else if (id === 'cursus_1') nbCursus = 1; else if (id === 'cursus_2') nbCursus = 2; else if (id === 'cursus_3') nbCursus = 3; $('.cursus').removeClass('selected-cursus'); $(this).addClass('selected-cursus'); $(".cursus").removeClass("active-cursus"); $(this).addClass("active-cursus"); calcualtePrice() }); $('.adulte').on('click', function (event) { var id = $(this).attr('id'); nbCursus = 0; if (id === 'adulte_0') nbAdulte = 0; else if (id === 'adulte_1') nbAdulte = 1; else if (id === 'adulte_2') nbAdulte = 2; $('.adulte').removeClass('selected-adulte'); $(this).addClass('selected-adulte'); $(".adulte").removeClass("active-adulte"); $(this).addClass("active-adulte"); calcualtePrice() }); calcualtePrice(); }); function calcualtePrice(val) { console.info('fromBrumath: '+fromBrumath); console.info('nbEveil: '+nbEveil); console.info('nbCursus: '+nbCursus); console.info('nbAdulte: '+nbAdulte); var totalPrice = 0; if (fromBrumath) { if (nbCursus > 1) { totalPrice = (174 * nbEveil) + 498 + (432 * (nbCursus-1)) + (621 * nbAdulte);} else {totalPrice = (174 * nbEveil) + (498 * nbCursus) + (621 * nbAdulte);} } else { if (nbCursus > 1) { totalPrice = (186 * nbEveil) + 522 + (450 * (nbCursus-1)) + (651 * nbAdulte);} else {totalPrice = (186 * nbEveil) + (522 * nbCursus) + (651 * nbAdulte);} } $("#total").val(totalPrice.toFixed(2)); $("#trimestre").val(Math.round((totalPrice) / 4).toFixed(2)); }
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76