"Bootstrap Loan Calculator"
Bootstrap 3.3.0 Snippet by detain

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<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="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/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-offset-4 col-sm-5">
<h3 class="great">Upgrade / Downgrade VPS Slices</h3>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<form class="form-horizontal form-pricing" role="form">
<div class="price-slider">
<h4 class="great">VPS ID</h4>
<div class="btn-group btn-group-justified btn-primary" style="font-size: 24px; border-radius: 6px;">
<div class="btn-group btn-group-lg">
<button type="button" class="btn btn-primary btn-lg btn-block" id='vps_id' style="border-radius: 6px;">145541</button>
</div>
</div>
</div>
<div class="price-slider">
<h4 class="great">Hostname</h4>
<div class="btn-group btn-group-justified btn-primary" style="font-size: 24px; border-radius: 6px;">
<div class="btn-group btn-group-lg">
<button type="button" class="btn btn-primary btn-lg btn-block" id='vps_id' style="border-radius: 6px;">vps145541.trouble-free.net</button>
</div>
</div>
</div>
<div class="price-slider">
<h4 class="great">How Many Slices?</h4>
<span>···<strong>Up to 16 Slices can be attached to a VPS</strong></span>
<div class="col-sm-12" style="margin-top: 20px">
<div id="slider_amirol"></div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body {
padding-top: 60px;
}
.price-box {
margin: 0 auto;
background: #E9E9E9;
border-radius: 10px;
padding: 30px 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;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$(document).ready(function() {
$("#total").val("1");
$("#slider_amirol").slider({
range: "min",
animate: true,
min: 1,
max: 16,
step: 1,
slide: function(event, ui) {
update(1,ui.value); //changed
calcualtePrice(ui.value);
}
});
update();
calcualtePrice();
});
function update(slider,val) {
if(undefined === val) val = 1;
var amount = val;
$('#sliderVal').val(val);
$('#slider_amirol a').html('<label><span class="glyphicon glyphicon-chevron-left"></span> '+amount+' <span class="glyphicon glyphicon-chevron-right"></span></label>');
}
function calcualtePrice(val) {
if(undefined === val)
val = $('#sliderVal').val();
//var month = $('#month').val();
//var term = obj[month][$('#term').val()];
//var totalPrice = t[val]*term;
var totalPrice = val*6*12;
$("#total").val(totalPrice.toFixed(2));
$("#total12").val(Math.round((totalPrice)/12).toFixed(2));
$("#total52").val(Math.round((totalPrice)/52).toFixed(2));
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: