Jump to content
Search Community

How do I make an observer move in opposite directions when touch

FrEZ test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I see that you have managed to achieve it. Is it possible for me to get the old and new code to see what you have changed to make it work, as just switching wheelspeed didn't do it for me, as I am not using a separate scrolltrigger to enable Observer. Cheers!

Link to comment
Share on other sites

  • Solution

I added the onPress to preventDefault() on the touchstart, and just flip-flopped the onUp/onDown logic. 

// old
onUp: () => !animating && gotoPanel(currentIndex - 1, false),
onDown: () => !animating && gotoPanel(currentIndex + 1, true),

// new
onUp: () => !animating && gotoPanel(currentIndex + 1, true),
onDown: () => !animating && gotoPanel(currentIndex - 1, false),
wheelSpeed: -1,

 

  • Like 2
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...