showing results for - "detect when page scroll to div javascript no jquery"
Lili-Rose
23 Oct 2017
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});