From 580ca1b017491f8815f2c01a778c2e133b6a6144 Mon Sep 17 00:00:00 2001 From: Angel Gonzalez Date: Fri, 5 Jan 2024 23:48:31 +0100 Subject: [PATCH] scroll into chart view in script.js --- script.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index b19e2f3..cd4700f 100644 --- a/script.js +++ b/script.js @@ -118,9 +118,8 @@ function runSimulations() { } }); - // Scroll to the bottom of the page - window.scrollTo({ - top: document.body.scrollHeight, + // Scroll to the chart element + resultElement.scrollIntoView({ behavior: 'smooth' }); }