From f9aa8cfcd7bcbe574ae1f5f4b5222be6996c3daf Mon Sep 17 00:00:00 2001 From: Dooho Yi Date: Thu, 24 Nov 2022 21:52:20 +0900 Subject: [PATCH] bug fix. --- src/pages/parade.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/parade.html b/src/pages/parade.html index 0f63567..bb7f9b6 100644 --- a/src/pages/parade.html +++ b/src/pages/parade.html @@ -438,11 +438,6 @@ //**ENTRY // list_reload(); - //go to the anchor - console.log(window.location.hash.substring(1)); - let elmnt = document.getElementById(window.location.hash.substring(1)); - elmnt.scrollIntoView(true); - var cnv = createCanvas(cols * unit + 2, rows * unit + 2); cnv.parent("p5"); img = createGraphics(cols * unit + 2, rows * unit + 2); @@ -454,6 +449,13 @@ document.querySelectorAll('.clear').forEach(item => item.onclick = () => { for (let a = 0; a < p.length; a++) p[a] = 0; }); + + //go to the anchor + console.log(window.location.hash.substring(1)); + let elmnt = document.getElementById(window.location.hash.substring(1)); + if (elmnt) { + elmnt.scrollIntoView(true); + } } //**ENTRY begin >>>