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

Play on scroll down / Reverse on scroll up

  • October 1, 2018
  • 1 reply
  • 589 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 has been closed for replies.
    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).

    1 reply

    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);

    }