Fade In on Scroll Down, Fade Out on Scroll Up – based on element position in window
The reason your attempt wasn’t working, is because the two animations (fade-in and fade-out) were working against each other. Right before an object became visible, it was still invisible and so the animation for fading-out would run. Then, the fraction of a second later when that same object had become visible, the fade-in animation would … Read more