Actually, max is the end that I want.. My content won't go beyond this scrollable.. I want the header and nav to always to in view. Thats why I made them have sticky positioning. I've come pretty far with this script:
cards.forEach((card, index) => {
ScrollTrigger.create({
trigger: card,
start: "top top+=400",
pin: true,
pinSpacing: false,
markers: true,
id: 'pin',
end: 'max',
invalidateOnRefresh: true,
scrub: 2
});
});
What I am struggling with is that the divs seem to overlap and no longer have their original space between them. I am also changing the scale of the header down as scrolled down, but I dont know how I can move the pinned items up to compensate for the size change of the header.. (And it scales back as you scroll back up, so the divs should be moved down again accordingly)
See this pen, this is roughly the behavior I have right now.. My issue stated above
https://codepen.io/jofairden/pen/rNdqPGQ