Hello,
I'm building a horizontal scroll website using scrollTrigger plugin. It works fine on mousewheel & mousedrag. But I need to scroll to specific sectons using <a> links & update the same to scrollTrigger plugin. I managed to click & scroll to specific section, but for some reason scrollTrigger won't work with mousewheel after this. I also noted that default mousewheel uses % values instead of px.
Pls refer to the codpen demo to see the issue.
I found a Gr
Ah yes, that's a bit tricky.
I guess since each of your sections is 100px narrower than the viewport, the 100px discrepancy would have to stack for each section.
This here works - multiplying the width of the navbar by the indexOf the targetElement within the sections array (not sure if there would be an easier way, though)
See the Pen 99a9bd60e87ad4b89ebb7baa00c14de7 by akapowl (@akapowl) on CodePen
Some notes on that: