Hi All,
I've ran into an issue I can't quite figure out and I'm throwing it out here to see if anybody has any insights.
I'm using ScrollTrigger to smooth scroll my entire page with this: gsap.to(container.current, {
y : () => -(getContainerHeight() - document.documentElement.clientHeight),
scrollTrigger: {
trigger: document.body,
start: "top top",
end: "bottom bottom",
scrub: 1,
invalidateOnRefresh: true
}
})
What I'm trying to get working is anchor links to different content on my page using the ScrollTo plugin like this: gsap.to( window, { duration : 1, scrollTo : `.page__index__${cls}`, ease : 'power2' } )
I've tried a handful of different options with the scrollTo plugin, but each one translates the page to somewhere around where I want it to go, but never the actual top of the element, where a regular anchor link would go. Does anybody have any experience with this or could provide any insight as to how I might get accurate anchor links? Please let me know if you need any more information!