diff --git a/app.js b/app.js index 0786f70..44683d0 100644 --- a/app.js +++ b/app.js @@ -74,8 +74,10 @@ document.querySelector("#btc-qr-link a").addEventListener("click", function(){ // Display BTC QR code if (document.contains(document.querySelector("#btc-js-qr"))) { document.querySelector("#btc-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#btcwall").insertAdjacentHTML("afterend", ""); + document.querySelector("#btc-qr-link").scrollIntoView({ behavior: "smooth" }); } }); @@ -91,8 +93,10 @@ document.querySelector("#eth-qr-link a").addEventListener("click", function(){ // Display ETH QR code if (document.contains(document.querySelector("#eth-js-qr"))) { document.querySelector("#eth-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#ethwall").insertAdjacentHTML("afterend", ""); + document.querySelector("#eth-qr-link").scrollIntoView({ behavior: "smooth" }); } }); @@ -108,7 +112,9 @@ document.querySelector("#doge-qr-link a").addEventListener("click", function(){ // Display DOGE QR code if (document.contains(document.querySelector("#doge-js-qr"))) { document.querySelector("#doge-js-qr").remove(); + valueBlock.scrollIntoView({ behavior: "smooth" }); } else { document.querySelector("#dogewall").insertAdjacentHTML("afterend", ""); + document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" }); } });