diff --git a/app.js b/app.js index b9ad678..e1c3041 100644 --- a/app.js +++ b/app.js @@ -10,6 +10,9 @@ document.querySelector('.value-block').addEventListener('toggle', function() { if (this.open) { // Scroll to contents of value block when it is opened valueBlock.scrollIntoView({ behavior: "smooth" }); + setTimeout(() => { + valueBlock.scrollIntoView({ behavior: "smooth" }); + }, 100); } else { // Scroll to top of button list when value block is closed } @@ -75,7 +78,9 @@ document.querySelector("#btc-qr-link a").addEventListener("click", function(){ document.querySelector("#btc-js-qr").remove(); } else { document.querySelector("#btcwall").insertAdjacentHTML("afterend", ""); - document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" }); + setTimeout(() => { + document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" }); + }, 100); } }); @@ -93,7 +98,9 @@ document.querySelector("#eth-qr-link a").addEventListener("click", function(){ document.querySelector("#eth-js-qr").remove(); } else { document.querySelector("#ethwall").insertAdjacentHTML("afterend", ""); - document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" }); + setTimeout(() => { + document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" }); + }, 100); } }); @@ -111,6 +118,8 @@ document.querySelector("#doge-qr-link a").addEventListener("click", function(){ document.querySelector("#doge-js-qr").remove(); } else { document.querySelector("#dogewall").insertAdjacentHTML("afterend", ""); - document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" }); + setTimeout(() => { + document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" }); + }, 100); } });