css on my website but I would like the animation to start only when the element appears on the page.
I have something like this:
HTML
<footer id="footer" class="animate__animated">
<div class="footer-all">
<img src="img/logo-hero@2x.png" alt="" class="logo-footer">
<p class="copyright">CASA DI AMICI C 2020 All rights reserved</p>
</div>
</footer>
CSS spec: After installing Animate.css, add the class animate__animated to an element, along with any of the animation names. Name of animation: animate__fadeIn
JS
let footer = document.getElementById("footer");
window.addEventListener("scroll", function() {
footer.classList.add('animate__fadeIn');
});
but "scroll" doesn't work, I try load but still doesn't work. please help me with this