I use JS UI Slider to make something like timeline. I want, when the year value increase with 1 - my output value to reduce with 0,662%. Some ideas? How I can do it?
$(function() {
$("#slider-range-min").slider({
range: "min",
value: 733131,
min: 0,
max: 10000000,
slide: function(event, ui) {
$("#amount").val(ui.value * (1 - 0.66 / 100));
}
});
});
<p>
<input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;">
</p>
<div id="slider-range-min"></div>
I think you want something like the following:
I've changed the
value
to be the current year,max
to be year 2218, added thestep
option to increment only by whole numbers, added ayear
div to display the year, and changed theamount
div output to be the difference in years times0.00662
deducted from the original amount of animals.