// フッター上で追従ボタンを非表示 const button = document.querySelector(".fixed-btn"); const footer = document.querySelector("footer"); window.addEventListener("scroll", () => { const buttonRect = button.getBoundingClientRect(); const footerRect = footer.getBoundingClientRect(); if (buttonRect.bottom > footerRect.top) { button.style.opacity = "0"; } else { button.style.opacity = "1"; } });