Copy link to clipboard
Copied
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
no, use e.deltaY. it's pos or negative depending on up/down (or down/up).
Copy link to clipboard
Copied
html5 or as3?
Copy link to clipboard
Copied
html5
Copy link to clipboard
Copied
you can use the wheel event:
window.addEventListener('wheel',f.bind(this));
function f(e){
console.log(e.deltaY);
}
Copy link to clipboard
Copied
Thanks a lot
Is there a wheel up and wheel down function ?
Copy link to clipboard
Copied
no, use e.deltaY. it's pos or negative depending on up/down (or down/up).
Copy link to clipboard
Copied
Thanks you so much, you're the boss
Copy link to clipboard
Copied
Bear in mind, if this animation is intended to be embedded in a scrolling page, and you're just listening for wheel activity, you won't necessarily stay synched with the actual page position.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now