add slight delay to allow for QR code images to load before scrolling
This commit is contained in:
9
app.js
9
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", "<span class=\"crypto-js-qr\" id=\"btc-js-qr\"><img src=\"images/crypto/btc-qr.png\"></span>");
|
||||
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", "<span class=\"crypto-js-qr\" id=\"eth-js-qr\"><img src=\"images/crypto/eth-qr.png\"></span>");
|
||||
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", "<span class=\"crypto-js-qr\" id=\"doge-js-qr\"><img src=\"images/crypto/doge-qr.png\"></span>");
|
||||
setTimeout(() => {
|
||||
document.querySelector("#doge-qr-link").scrollIntoView({ behavior: "smooth" });
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user