Showing all 2 results

document.addEventListener("DOMContentLoaded", function() { const fadeElements = document.querySelectorAll('.fade-in'); function handleScroll() { fadeElements.forEach(element => { const rect = element.getBoundingClientRect(); if (rect.top < window.innerHeight && rect.bottom > 0) { element.classList.add('show'); } }); } window.addEventListener('scroll', handleScroll); handleScroll(); });