I am using this code to scroll:
if (window.addEventListener) {
window.addEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = wheel;
function wheel(event) {
var delta = 0;
if (event.wheelDelta) {
(delta = event.wheelDelta / 120);
} else if (event.detail) {
(delta = -event.detail / 3);
}
handle(delta);
if (event.preventDefault) {
(event.preventDefault());
}
event.returnValue = false;
}
function handle(delta) {
var time = 800;
var distance = 300;
$('html, body').stop().animate({
scrollTop: $(window).scrollTop() - (distance * delta)
}, time);
}
Everything's working fine but it's a bit annoying that little steps that appears when user is trying to scroll more than once.
I'm not able to use some custom scrollbar to avoid that problem as I'm using paroller to make same effects.
Is there any way to prevent user to scroll again until that animate ends?