I need more of an explanation than anything, but examples are welcomed.
I am trying to make it so when I scroll down a specific element on-screen will fade in on scroll.
The only issue is that I need a way to determine how far down the element in from the top using the code provided (or a better method that would work).
is there a different way to make the scrolling effect work without having to base it off the pixel units from the top?
If not how can you find the distance?
This is the code I've been working with.
if (window.scrollY>300)