I have a (fake) horizontal scrolling site using ScrollTrigger. I have a menu that needs to link to the second section (#section2). Both the first and second sections are full width (100vw). I am able to scroll close to the section, but there is a gap between the left of the screen and the beginning of the section. How do I get it to correctly jump all the way to the section?
I provided a minimal demo with the link inside the first section. I greatly appreciate any help on this
You're basing your calculation on the horizontal position (left) whereas you actually need to correlate it to the vertical scroll position.
There are a bunch of ways to do this, but it has been asked before in the forums so I just created a new helper function that should make it a lot easier. It's in the docs now too.
I forked your demo, added a list of links in a fixed-position <div> and leveraged this helper function:
/*
Returns a FUNCTION that you c