Skip to main content
patrickb89495570
Known Participant
October 1, 2018
Answered

Play on scroll down / Reverse on scroll up

  • October 1, 2018
  • 7 replies
  • 598 views

Hello everyone,

Here is my question

i have a simple animation, and i want it to play while the user is scrolling down. Pause when he stop scrolling, and reverse when he scroll up.

Could be so usefull

Thanks a lot

Patrick

    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer kglad

    Thanks a lot

    Is there a wheel up and wheel down function ?


    no, use e.deltaY.  it's pos or negative depending on up/down (or down/up).

    7 replies

    kglad
    Community Expert
    Community Expert
    October 1, 2018

    html5 or as3?

    patrickb89495570
    Known Participant
    October 1, 2018

    html5

    kglad
    Community Expert
    Community Expert
    October 1, 2018

    you can use the wheel event:

    window.addEventListener('wheel',f.bind(this));

    function f(e){

    console.log(e.deltaY);

    }