We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7601bdb commit dd86933Copy full SHA for dd86933
13 - Slide in on Scroll/index-START.html 13 - Slide in on Scroll/index.html13 - Slide in on Scroll/index-START.html renamed to 13 - Slide in on Scroll/index.html
@@ -62,9 +62,9 @@ <h1>Slide in on Scroll</h1>
62
63
function checkSlide(e) {
64
sliderImages.forEach(sliderImage => {
65
- // half way through the image
+ //middle of the image
66
const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2;
67
- // bottom of the image
+ //bottom of image
68
const imageBottom = sliderImage.offsetTop + sliderImage.height;
69
const isHalfShown = slideInAt > sliderImage.offsetTop;
70
const isNotScrolledPast = window.scrollY < imageBottom;
@@ -75,7 +75,6 @@ <h1>Slide in on Scroll</h1>
75
}
76
});
77
78
-
79
window.addEventListener('scroll', debounce(checkSlide));
80
81
</script>
0 commit comments