Add display of QR codes when link is clicked
This commit is contained in:
30
app.js
30
app.js
@@ -64,27 +64,39 @@ document.querySelector("#doge-qr-link a").addEventListener("click", function(eve
|
||||
|
||||
// Watch for click on BTC QR code link
|
||||
document.querySelector("#btc-qr-link a").addEventListener("click", function(){
|
||||
console.log('BTC QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
if (document.contains(document.querySelector("#eth-js-qr"))) {
|
||||
document.querySelector("#eth-js-qr").remove();
|
||||
}
|
||||
if (document.contains(document.querySelector("#doge-js-qr"))) {
|
||||
document.querySelector("#doge-js-qr").remove();
|
||||
}
|
||||
// Display BTC QR code
|
||||
|
||||
document.querySelector("#btcwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"btc-js-qr\"><img src=\"images/crypto/btc-qr.png\"></span>");
|
||||
});
|
||||
|
||||
// Watch for click on ETH QR code link
|
||||
document.querySelector("#eth-qr-link a").addEventListener("click", function(){
|
||||
console.log('ETH QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
if (document.contains(document.querySelector("#btc-js-qr"))) {
|
||||
document.querySelector("#btc-js-qr").remove();
|
||||
}
|
||||
if (document.contains(document.querySelector("#doge-js-qr"))) {
|
||||
document.querySelector("#doge-js-qr").remove();
|
||||
}
|
||||
// Display ETH QR code
|
||||
|
||||
document.querySelector("#ethwall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"eth-js-qr\"><img src=\"images/crypto/eth-qr.png\"></span>");
|
||||
});
|
||||
|
||||
// Watch for click on DOGE QR code link
|
||||
document.querySelector("#doge-qr-link a").addEventListener("click", function(){
|
||||
console.log('DOGE QR Clicked');
|
||||
// Hide all other QR codes
|
||||
|
||||
if (document.contains(document.querySelector("#btc-js-qr"))) {
|
||||
document.querySelector("#btc-js-qr").remove();
|
||||
}
|
||||
if (document.contains(document.querySelector("#eth-js-qr"))) {
|
||||
document.querySelector("#eth-js-qr").remove();
|
||||
}
|
||||
// Display DOGE QR code
|
||||
|
||||
document.querySelector("#dogewall").insertAdjacentHTML("afterend", "<span class=\"crypto-js-qr\" id=\"doge-js-qr\"><img src=\"images/crypto/doge-qr.png\"></span>");
|
||||
});
|
||||
|
Reference in New Issue
Block a user