Hey guys, I have a question regarding this plugin. I have a website that uses horizontal scroll, the main div has children sections and the sections have their content.
Now a I have a separate navigation menu on top and what I need to do is to show which section you're in, so I need to track when a section has pass the middle of the screen so I can highlight the navigation menu. It's there a way to do this with this plugin.
I don't have a codeped but here is the link to my website https://dev-shapetx.pantheonsite.io/
This is the code that I use to initiate the plugin
this.scroll = gsap.to(this.container, {
x: () => -( (this.container.scrollWidth - document.documentElement.clientWidth) ) + "px",
ease: "none",
scrollTrigger: {
trigger: this.container,
invalidateOnRefresh: true,
pin: true,
scrub: 0.2,
end: () => "+=" + (this.container.scrollWidth - document.documentElement.clientWidth)
}
});