From e2fddd9584b96ac5fef7d7550e726c6cf359bc60 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 19 Sep 2023 13:12:34 -0700 Subject: [PATCH] More robust autoscrolling (attempt) --- js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index c93ae342..f4e20f89 100644 --- a/js/main.js +++ b/js/main.js @@ -113,7 +113,7 @@ let isScrolled = false; targetElement.addEventListener('scroll', function() { let diff = targetElement.scrollHeight - targetElement.clientHeight; - if(Math.abs(targetElement.scrollTop - diff) <= 1 || diff == 0) { + if(Math.abs(targetElement.scrollTop - diff) <= 10 || diff == 0) { isScrolled = false; } else { isScrolled = true; @@ -161,7 +161,7 @@ let notebookScrolled = false; notebookElement.addEventListener('scroll', function() { let diff = notebookElement.scrollHeight - notebookElement.clientHeight; - if(Math.abs(notebookElement.scrollTop - diff) <= 1 || diff == 0) { + if(Math.abs(notebookElement.scrollTop - diff) <= 10 || diff == 0) { notebookScrolled = false; } else { notebookScrolled = true; @@ -186,7 +186,7 @@ let defaultScrolled = false; defaultElement.addEventListener('scroll', function() { let diff = defaultElement.scrollHeight - defaultElement.clientHeight; - if(Math.abs(defaultElement.scrollTop - diff) <= 1 || diff == 0) { + if(Math.abs(defaultElement.scrollTop - diff) <= 10 || diff == 0) { defaultScrolled = false; } else { defaultScrolled = true;