window.addEventListener("scroll", function() { const heroSection = document.getElementById("new-banner"); // Replace with your hero section ID const banner = document.getElementById("new-feature-banner"); // Replace with your banner ID const heroHeight = heroSection.offsetHeight; const offset = 400; // Offset value in pixels console.log("shdgfh", window.scrollY) console.log("height", (heroHeight + offset)) if (window.scrollY > heroHeight) { banner.style.opacity = 0; } else { banner.style.opacity = 1; } });