diff --git a/nginx/vue/src/components/util/AutoScroll.vue b/nginx/vue/src/components/util/AutoScroll.vue index acf041d..d814350 100644 --- a/nginx/vue/src/components/util/AutoScroll.vue +++ b/nginx/vue/src/components/util/AutoScroll.vue @@ -13,6 +13,7 @@ const SPEED = 0.5; // px per frame const PAUSE = 2000; // ms at top/bottom let direction = 1; // 1 = down, -1 = up +let scrollPos = 0; let timeoutId; let timeoutId2; @@ -27,7 +28,8 @@ function handleHover() { function tick() { const el = container.value; - el.scrollTop += SPEED * direction; + scrollPos += SPEED * direction; + el.scrollTop = scrollPos; const reachedBottom = el.scrollTop + el.clientHeight >= el.scrollHeight; const reachedTop = el.scrollTop <= 0;