From 3ff93e4d1f31a114926a71dd6e30a4a0b5804792 Mon Sep 17 00:00:00 2001 From: Folkert Kevelam Date: Sun, 31 Aug 2025 21:23:10 +0200 Subject: [PATCH] Add scroll option --- template/index.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/template/index.html b/template/index.html index 2bd6169..398f44b 100644 --- a/template/index.html +++ b/template/index.html @@ -75,12 +75,10 @@ socket.addEventListener("message", (event) => { var data = JSON.parse(event.data); Object.entries(data).forEach(([k,v]) => { - console.log(k,v); switch (k) { case "scroll": - var height = window.innerHeight - || document.documentElement.clientHeight - || document.body.clientHeight; + var height = window.scrollHeight + || document.body.scrollHeight; window.scrollTo({left : 0, top: height * v, behavior: 'smooth'}); break;