Jump to content
Search Community

Allowing horizontal scrolling or dragging with Scrolltrigger

Okaia test
Moderator Tag

Recommended Posts

Hello,


Very happy user of GSAP here! But there is one thing we need your help with.

 

On our website we are using something like this for a section with a horizontal slider. Works great, but it confuses some not so tech savy people since they have to scroll down to go to the right. Especially on mobile this feels unnatural to them.

 

Is there a way to link horizontal scrolling to vertical scrolling, so it doesn't matter which way you scroll, you go down?

Or is there a way to allow dragging the slides to the right, like a carousel, in addition to the regular scroll behaviour?

 

Thanks for the help.

See the Pen NWpGeZX by ekfuhrmann (@ekfuhrmann) on CodePen

Link to comment
Share on other sites

Hi @Okaia and welcome to the GreenSock forums!

 

First thanks for being a Club GreenSock member and supporting GreenSock!

 

This example of the container animation implements the Observer Plugin in order to update the animation with the regular mouse wheel and swipe left/right on that particular section (line 30 of the JS tab):

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

 

Hopefully this is enough to get you started. Let us know if you have more questions.

Happy Tweening!

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