Jump to content
Search Community

WheelEvent, Draggable, Spin

benoit test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

The current API does not support WheelEvent directly, and I'm not sure how likely it is that it  would be added any time soon. Perhaps if there is more demand.

 

However, there should be plenty of hooks available so that you could wire it up yourself. You could probably even detect the velocity of the wheel spinning and pass that off to ThrowProps tween that smoothly animates the wheel based on that velocity. However, that isn't a road I can go down to far right now.

 

Take a look at this demo that allows the horizontal scrolling of a div to control how far a draggable element spins. Since the div can be scrolled with the mouse wheel so can the draggable. 

 

See the Pen gnoDc by GreenSock (@GreenSock) on CodePen

 

I provide this demo just to show that if scrolling a div can control a draggable thing, you should be able to wire it up to anything.

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...