let isScrolling = false;
window.addEventListener('scroll', function(e) {
if(isScrolling) {
e.preventDefault();
return;
}
// handler
});
function scrollTo() {
isScrolling = true;
window.scrollTo({
top: 100,
behavior: "smooth"
});
setTimeout(() => isScrolling = false, 500);
}