Skip to content
Advertisement

javascript detect scrolling past the end of the window when scroll event doesn’t fire

I have a site in which all sections take 100vh/vw, and I want to animate the opacity transition when user attempts to scroll up/down.

The thing is, the scroll event doesn’t fire because the window hasn’t really scrolled.

here’s the codepen, and the gist of it:

JavaScript

is this even possible?

And if not, any ideas for a workaround?

Advertisement

Answer

Change keyword scroll to wheel, this event fires when you try to scroll from mouse/pad(using fingers)even there is not scroll

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement