1window.addEventListener("scroll", function() {
2 var elementTarget = document.getElementById("section-2");
3 if (window.scrollY > (elementTarget.offsetTop + elementTarget.offsetHeight)) {
4 alert("You've scrolled past the second div");
5 }
6});