"Payment Plan"
Bootstrap 3.1.0 Snippet by streamvest

<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> <!------ Include the above in your HEAD tag ----------> <div class="container"> <H1>Setup a payment plan</H1> <hr> <div class="row"> <form class="form-horizontal"> </form> <h5><strong>Current balance: </strong>£123.00</h5> <br> <label class="control-label">How often?</label> <div class="btn-group"> <button type="button" class="btn btn-default">Monthly</button> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu"> <li><a href="#">Weekly</a></li> </ul> </div> <br> <label class="control-label">What Day?</label> <div class="btn-group"> <button type="button" class="btn btn-default">1</button> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu"> <li><a href="#">1</a></li> </ul> </div> <br> <label class="control-label">How would you like to pay?</label> <div class="btn-group"> <button type="button" class="btn btn-default">Debit Card</button> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu"> <li><a href="#">Direct Debit</a></li> <li><a href="#">Cheque</a></li> <li><a href="#">Standing Order</a></li> </ul> </div> <br> <label class="control-label">When would you like to start?</label> <div class="btn-group"> <button type="button" class="btn btn-default">01/11/2016</button> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu"> <li><a href="#">01/11/2016</a></li> </ul> </div> <div class="row"> <div class="col-md-8"> <form class="form-pricing" role="form"> <div class="price-slider"> <h4 class="great">How much can you afford to pay?</h4> <span>Minimum £1 is required</span> <div class="col-sm-12"> <div id="slider"></div> </div> </div> <div class="price-slider"> <h4 class="great">This is how long it will take to clear your total balance</h4> <span>Minimum 1 instalment is required</span> <div class="col-sm-12"> <div id="slider2"></div> </div> </div> <p>by default we will split your offer equally against your outstanding accounts, if you would like to change this please alter the 'how much' field below.</p> <div class="panel panel-primary filterable"> <div class="panel-heading"> <h3 class="panel-title"><strong>How would you like to split your payments?</strong></h3> </div> <table class="table"> <thead> <tr> <th>Original Creditor</th> <th>Original Creditor Reference</th> <th>Outstanding</th> <th class="col-md-2">How much?</th> </tr> </thead> <tbody> <tr> <td>Test1</td> <td>123</td> <td>£120.00</td> <td class="col-md-2"> <div class="input-group"> <span class="input-group-addon">£</span> <input type="text" class="form-control" aria-describedby="basic-addon1"> </div> </td> </tr> <tr> <td>Test2</td> <td>vsd32d</td> <td>£1020.00</td> <td class="col-md-2"> <div class="input-group"> <span class="input-group-addon">£</span> <input type="text" class="form-control" aria-describedby="basic-addon1"> </div> </td> </tr> <tr> <td>Test3</td> <td>abc123</td> <td>£200.00</td> <td class="col-md-2"> <div class="input-group"> <span class="input-group-addon">£</span> <input type="text" class="form-control" aria-describedby="basic-addon1"> </div> </td> </tr> </tbody> </table> </div> </div> </div> <div class="form-group"> <div class="col-sm-8"> <button type="submit" class="btn btn-success btn-lg btn-block">Proceed <span class="glyphicon glyphicon-chevron-right pull-right" style="padding-right: 10px;"></span></button> </div> </div> </form> </div> </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: 750px; } .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; }
$(document).ready(function() { $("#slider").slider({ animate: true, value:1, min: 0, max: 1000, step: 10, slide: function(event, ui) { update(1,ui.value); //changed } }); $("#slider2").slider({ animate: true, value:0, min: 0, max: 500, step: 1, slide: function(event, ui) { update(2,ui.value); //changed } }); //Added, set initial value. $("#amount").val(0); $("#duration").val(0); $("#amount-label").text(0); $("#duration-label").text(0); update(); }); //changed. now with parameter function update(slider,val) { //changed. Now, directly take value from ui.value. if not set (initial, will use current value.) var $amount = slider == 1?val:$("#amount").val(); var $duration = slider == 2?val:$("#duration").val(); /* commented $amount = $( "#slider" ).slider( "value" ); $duration = $( "#slider2" ).slider( "value" ); */ $total = "£" + ($amount * $duration); $( "#amount" ).val($amount); $( "#amount-label" ).text($amount); $( "#duration" ).val($duration); $( "#duration-label" ).text($duration); $( "#total" ).val($total); $( "#total-label" ).text($total); $('#slider a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+$amount+' <span class="glyphicon glyphicon-chevron-right"></span></label>'); $('#slider2 a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+$duration+' <span class="glyphicon glyphicon-chevron-right"></span></label>'); }

Related: See More


Questions / Comments: