Skip to content

Commit dd86933

Browse files
committed
Day 13 - Slide in on scroll
1 parent 7601bdb commit dd86933

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ <h1>Slide in on Scroll</h1>
6262

6363
function checkSlide(e) {
6464
sliderImages.forEach(sliderImage => {
65-
// half way through the image
65+
//middle of the image
6666
const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2;
67-
// bottom of the image
67+
//bottom of image
6868
const imageBottom = sliderImage.offsetTop + sliderImage.height;
6969
const isHalfShown = slideInAt > sliderImage.offsetTop;
7070
const isNotScrolledPast = window.scrollY < imageBottom;
@@ -75,7 +75,6 @@ <h1>Slide in on Scroll</h1>
7575
}
7676
});
7777
}
78-
7978
window.addEventListener('scroll', debounce(checkSlide));
8079

8180
</script>

0 commit comments

Comments
 (0)