"Pricing"
Bootstrap 4.0.0 Snippet by IndrekSaarnak

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/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 ----------> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <div class="container"> <div class="price-slider"> <h4 class="great">Users</h4> <div class="col-sm-12"> <div id="slider"></div> </div> </div> </div> <div class="container content"> <div class="row"> <!-- Pricing --> <div class="col-md-3"> <div class="pricing hover-effect"> <div class="pricing-head"> <h3>Basic</h3> <h4 data-start="0" data-end="5"><i>€</i>0<i></i></h4> <h4 data-start="6" data-end="10" style="display: none"><i>€</i>59<i></i></h4> <h4 data-start="11" data-end="20" style="display: none"><i>€</i>99<i></i></h4> <h4 data-start="21" data-end="30" style="display: none"><i>€</i>149<i></i></h4> <h4 data-start="31" data-end="40" style="display: none"><i>€</i>199<i></i></h4> <h4 data-start="41" data-end="50" style="display: none"><i>€</i>249<i></i></h4> <h4 data-start="51" data-end="60" style="display: none"><i>€</i>299<i></i></h4> <h4 data-start="61" data-end="70" style="display: none"><i>€</i>349<i></i></h4> <h4 data-start="71" data-end="80" style="display: none"><i>€</i>389<i></i></h4> <h4 data-start="81" data-end="90" style="display: none"><i>€</i>429<i></i></h4> <h4 data-start="91" data-end="100" style="display: none"><i>€</i>479<i></i></h4> </div> <ul class="pricing-content list-unstyled"> <li> At vero eos </li> <li> No Support </li> <li> Fusce condimentum </li> <li> Ut non libero </li> <li> Consecte adiping elit </li> </ul> </div> </div> <div class="col-md-3"> <div class="pricing hover-effect"> <div class="pricing-head"> <h3>Reports</h3> <h4 data-start="0" data-end="5"><i>€</i>39<i></i></h4> <h4 data-start="6" data-end="10" style="display: none"><i>€</i>79<i></i></h4> <h4 data-start="11" data-end="20" style="display: none"><i>€</i>139<i></i></h4> <h4 data-start="21" data-end="30" style="display: none"><i>€</i>199<i></i></h4> <h4 data-start="31" data-end="40" style="display: none"><i>€</i>259<i></i></h4> <h4 data-start="41" data-end="50" style="display: none"><i>€</i>319<i></i></h4> <h4 data-start="51" data-end="60" style="display: none"><i>€</i>379<i></i></h4> <h4 data-start="61" data-end="70" style="display: none"><i>€</i>439<i></i></h4> <h4 data-start="71" data-end="80" style="display: none"><i>€</i>499<i></i></h4> <h4 data-start="81" data-end="90" style="display: none"><i>€</i>559<i></i></h4> <h4 data-start="91" data-end="100" style="display: none"><i>€</i>599<i></i></h4> </div> <ul class="pricing-content list-unstyled"> <li> At vero eos </li> <li> No Support </li> <li> Fusce condimentum </li> <li> Ut non libero </li> <li> Consecte adiping elit </li> </ul> </div> </div> <div class="col-md-3"> <div class="pricing hover-effect"> <div class="pricing-head"> <h3>Video</h3> <h4 data-start="0" data-end="5"><i>€</i>79<i></i></h4> <h4 data-start="6" data-end="10" style="display: none"><i>€</i>109<i></i></h4> <h4 data-start="11" data-end="20" style="display: none"><i>€</i>189<i></i></h4> <h4 data-start="21" data-end="30" style="display: none"><i>€</i>279<i></i></h4> <h4 data-start="31" data-end="40" style="display: none"><i>€</i>369<i></i></h4> <h4 data-start="41" data-end="50" style="display: none"><i>€</i>459<i></i></h4> <h4 data-start="51" data-end="60" style="display: none"><i>€</i>549<i></i></h4> <h4 data-start="61" data-end="70" style="display: none"><i>€</i>639<i></i></h4> <h4 data-start="71" data-end="80" style="display: none"><i>€</i>729<i></i></h4> <h4 data-start="81" data-end="90" style="display: none"><i>€</i>819<i></i></h4> <h4 data-start="91" data-end="100" style="display: none"><i>€</i>899<i></i></h4> </div> <ul class="pricing-content list-unstyled"> <li> At vero eos </li> <li> No Support </li> <li> Fusce condimentum </li> <li> Ut non libero </li> <li> Consecte adiping elit </li> </ul> </div> </div> <!--//End Pricing --> </div> </div> <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
body { padding-top: 50px; padding-bottom: 50px; } .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: 5.2em; height: 2.2em; cursor: default; margin: 0 -40px auto !important; text-align: center; line-height: 30px; color: #FFFFFF; font-size: 15px; } .ui-slider .ui-slider-handle .glyphicon { color: #FFFFFF; margin: 0 3px; font-size: 11px; opacity: 0.5; } .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; } 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; 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: 32px; 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; } /* HR */ hr.style { margin-top: 0; border: 0; border-bottom: 1px dashed #ccc; background: #999; } .content { padding: 30px 0; } /*** Pricing table ***/ .pricing { position: relative; margin-bottom: 15px; border: 3px solid #eee; } .pricing-active { border: 3px solid #36d7ac; margin-top: -10px; box-shadow: 7px 7px rgba(54, 215, 172, 0.2); } .pricing:hover { border: 3px solid #36d7ac; } .pricing:hover h4 { color: #36d7ac; } .pricing-head { text-align: center; } .pricing-head h3, .pricing-head h4 { margin: 0; line-height: normal; } .pricing-head h3 span, .pricing-head h4 span { display: block; margin-top: 5px; font-size: 14px; font-style: italic; } .pricing-head h3 { font-weight: 300; color: #fafafa; padding: 12px 0; font-size: 27px; background: #36d7ac; border-bottom: solid 1px #41b91c; } .pricing-head h4 { color: #bac39f; padding: 5px 0; font-size: 54px; font-weight: 300; background: #fbfef2; border-bottom: solid 1px #f5f9e7; } .pricing-head-active h4 { color: #36d7ac; } .pricing-head h4 i { top: -8px; font-size: 28px; font-style: normal; position: relative; } .pricing-head h4 span { top: -10px; font-size: 14px; font-style: normal; position: relative; } /*Pricing Content*/ .pricing-content li { color: #888; font-size: 12px; padding: 7px 15px; border-bottom: solid 1px #f5f9e7; } /*Pricing Footer*/ .pricing-footer { color: #777; font-size: 11px; line-height: 17px; text-align: center; padding: 0 20px 19px; } /*Priceing Active*/ .price-active, .pricing:hover { z-index: 9; } .price-active h4 { color: #36d7ac; } .no-space-pricing .pricing:hover { transition: box-shadow 0.2s ease-in-out; } .no-space-pricing .price-active .pricing-head h4, .no-space-pricing .pricing:hover .pricing-head h4 { color: #36d7ac; padding: 15px 0; font-size: 80px; transition: color 0.5s ease-in-out; } .yellow-crusta.btn { color: #FFFFFF; background-color: #f3c200; } .yellow-crusta.btn:hover, .yellow-crusta.btn:focus, .yellow-crusta.btn:active, .yellow-crusta.btn.active { color: #FFFFFF; background-color: #cfa500; }
$(document).ready(function() { let sliderAmountMap = [1, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; $("#slider").slider({ animate: true, value:1, min: 1, max: sliderAmountMap.length-1, slide: function( event, ui ) { update(sliderAmountMap[ui.value] ); //map selected "value" with lookup array } }); //Added, set initial value. $("#amount").val(1); $("#amount-label").text(1); update(); }); //changed. now with parameter function update(val) { var prices = $('.pricing-head').find('h4') if(!val) val = 1 prices.hide() prices.each(function() { var elem = $(this) if(elem.data('start') <= val && elem.data('end') >= val) { elem.show() } }) //changed. Now, directly take value from ui.value. if not set (initial, will use current value.) var $amount = val; $( "#amount" ).val($amount); $( "#amount-label" ).text($amount); $('#slider a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+$amount+' <span class="glyphicon glyphicon-chevron-right"></span></label>'); }

Related: See More


Questions / Comments: