如果我滑走了,我想從另一個變量的值減去滑塊的值,如果我滑,我想請滑塊的值添加到另一個標籤的值。離開引導滑動條幻燈片。減去,滑塊向右增加
現在它都減去......我用的是引導滑塊。
這是JavaScript:
function subtractfromBeg(newValue) {
var currentBeg = document.getElementById('amount');
document.getElementById("amount").innerHTML = parseInt(currentBeg.innerHTML) - newValue;
}
這是HTML
<div class="row">
<div class="col-md-12 teBetalen well">
<h2>Scenario: @Html.DisplayName(Model.ScenarioType.ToString())</h2>
<h3 id="amount">@Html.DisplayName(Model.Bedrag.ToString()) Euro</h3>
</div>
</div>
<input [email protected]("ex" + teller) data-slider-id='ex1Slider'onchange="***subtractfromBeg(this.value)"*** type="text" data-slider-min="@(projectCat?.Min_bedrag ?? 10)" data-slider-max="@(projectCat?.Max_bedrag ?? 20)" data-slider-step="1" data-slider-value="0" />
合計爲300 000
我希望圖片能夠清楚表達我的意思。我怎樣才能解決滑塊,讓它感覺到它左側,所以它再次累加?
而不是你的代碼的截圖,提供它作爲文本 –
嗨Lennart。歡迎 - 請閱讀如何詢問http://stackoverflow.com/help/how-to-ask。你需要在這裏顯示你的代碼而不是圖像。然後你可以在編輯器中將它變成一個代碼塊。 – micstr
功能subtractfromBeg(newValue)以{ VAR currentBeg =的document.getElementById( '量'); document.getElementById(「amount」)。innerHTML = parseInt(currentBeg.innerHTML) - newValue; } 對不起! –