Visitar URL original
Comment changes to #13 · ShimmiChristo/JavaScript30@e099346 · GitHub
Skip to content

Commit e099346

Browse files
committed
Comment changes to wesbos#13
1 parent 50dcd02 commit e099346

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎13 - Slide in on Scroll/index-START.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ <h1>Slide in on Scroll</h1>
6666
sliderImages.forEach( sliderImage => {
6767
//half way through the image
6868
const slideInAt = (window.scrollY + window.innerHeight) - sliderImage.height / 2;
69+
// console.log(slideInAt);
6970
// bottom of the image
71+
// offsetTop gives the distance from the top of the image to the top of the window
7072
const imageBottom = sliderImage.offsetTop + sliderImage.height;
7173
const isHalfShown = slideInAt > sliderImage.offsetTop;
7274
const isNotScrolledPast = window.scrollY < imageBottom;

0 commit comments

Comments
 (0)