0
我正在嘗試使用3個jquery-ui滑塊進行貸款計算。影響海誓山盟的多個jquery-ui值滑塊
的參數是:
金額借用個月的
時間/金額償還
利率
而改變滑動RS我想顯示的值:
月量+利率
(摺合個月的貸款/數量=結果+(結果*利率))貸款總額+總利率。
(貸款總額+(總貸款額*利率))
目前我只有滑塊,但我沒有設法將它們連接在一起,以計算和顯示這些值。非常感謝您的幫助。
這裏有一個小提琴 http://jsfiddle.net/L65u9spv/
的Javascript:
$(function() {
$("#slider-toloan").slider({
range: "min",
value: 25000,
min: 5000,
max: 400000,
step: 5000,
slide: function(event, ui) {
$("#amount").val("$" + ui.value);
}
});
$("#amount").val("$" + $("#slider-toloan").slider("value"));
$("#slider-loanduration").slider({
range: "min",
value: 5,
min: 1,
max: 25,
step: 1,
slide: function(event, ui) {
$("#duration").val(ui.value);
}
});
$("#duration").val($("#slider-loanduration").slider("value"));
$("#slider-rate").slider({
range: "min",
value: 1.85,
min: 1.75,
max: 23,
step: 0.05,
slide: function(event, ui) {
$("#rate").val(ui.value);
}
});
$("#rate").val($("#slider-rate").slider("value"));
});
HTML:
<p>
<label for="amount">Amount to Loan:</label>
<input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-toloan"></div>
<p>
<label for="duration">Duration Months:</label>
<input type="text" id="duration" readonly style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-loanduration"></div>
<p>
<label for="rate">Interest Rate</label>
<input type="text" id="rate" readonly style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-rate"></div>
<br /><br />
<p>To pay monthly (interest rate included): ?</p>
<span style="font-size:11px;">amount to loan/amount of months = result + (result * interest rate) </span>
<br />
<p>Total amount to pay all months (interest rate included): ?</p>
<span style="font-size:11px;">Total loan amount + (total loan amount * interest rate)</span>
非常感謝,效果很棒... – Toothfairy