Jump to content
Search Community

How to loop horizontal section scrolling behavior

Roman Truhanov test
Moderator Tag

Recommended Posts

Hi all!  I am writing vertical scroll loop work right. In documentation GreenSock | Docs | Plugins | ScrollTrigger | static.maxScroll() tell set flag

horizontal to true

any anyway not working. How to make same in horizontally? Maybe set not right Scroll Trigger position... If possible, want to see example for real scrolling and fake scrolling. Activation Scroll Trigger markers stopping or blocking working scrolling to up (top) it's a normal or bug in my code?

my stackblitz code example

Link to comment
Share on other sites

Welcome to the forums, @Roman Truhanov

 

I see two problems: 

  1. By default, ScrollTriggers only care about vertical scroll. If you want a ScrollTrigger to be horizontally-oriented instead, you must set horizontal: true
  2. A much bigger (but less obvious) problem I see is that you're literally creating an entirely new ScrollTrigger EVERY time there's a scroll, mousemove, touchmove, or wheel event! That's massively wasteful and problematic. You could easily end up with hundreds of thousands of active ScrollTriggers all doing the same thing. Big waste of memory and CPU. 

Are you just trying to do this?: 

https://stackblitz.com/edit/nuxt-starter-cr3zzj?file=app.vue

 

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...