Hey guys, I'm pretty new to GSAP as a whole, so I apologise if I'm missing something obvious! I've been reading the forums and documentation over the past weeks and some of the solutions worked great for some of the issues I found myself into, so thanks for that!
I'm trying to achieve the normal behaviour of a position: sticky; element, while enjoying the awesome ScrollSmoother Plugin. I somewhat achieved what I was going after, but the way I did it feels kinda wrong, so I'm guessing if there is a better way to achieve the same result.
Please, take a look at the start and end values, pinSpacing doesn't seem to make a difference in this example.
Thanks in advance ツ
ScrollTrigger.create({
markers: true,
trigger: stickyTrack[i],
pin: stickyEl[i],
start: () => `-=${gsap.getProperty(":root", "--siteHeader-height")}`,
end: () => `+=${stickyTrack[i].offsetHeight - stickyEl[i].offsetHeight}`,
pinSpacing: false
});