Answer the question
In order to leave comments, you need to log in
I get undefined with elem.srollY. Where is the mistake?
Hey!
Here is the demo.
I'm trying to display the distance in pixels from the top edge of the window to the element with the item5 class when scrolling.
But I get undefined.
Can't figure out why
console.log(window.scrollY); // Выдаёт расстояние в пикселях
console.log(elem.scrollY); // А тут получаю undefined.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question