function startAutoScrolling() {
var distance = y2 - y1;
var speed = distance / dateDiff;
interval1 = setInterval(function() { doAutoScrolling(speed); }, 1);
}
here I want to decrease step on 0.1 but it dosn't work like that, and I don't know why
function doAutoScrolling(step) {
document.getElementById(CONTEINER).scrollTop += step;
if (isGoingDown) {
step = step - 0.1;
console.log("step - 1: " + step);
if (step <= 0) {
clearInterval(interval1);
}
} else { // there is continue below
here I want to increase step and if condition have to stop execution of block but it doesn`t work also
step += 0.01;
if (step >= 0) {
clearInterval(interval1);
}
}
}