Hi All!
I have a quick question about your fixed header in CodePen that uses ScrollTrigger to show/hide it.
I've tried/failed numerous times to prevent the header from immediately animating on reverse (scroll up), but instead require a scroll threshold to first be met before the animation begins. In other words, I'd like the animation to begin only after a specific number of pixels, such as 30px. Is this possible using the onUpdate: (self) function or should a different
No, I don't think it's a bug. You set the start to "top top" but you never defined a trigger element, so it defaults to <body> but since the contents have a margin on the first element, the getClientBoundingRect() is about 16px from the top of the viewport, thus the ScrollTrigger's "start" value is 16 (because that's when the top of its content hits the top of the viewport). Your code is assuming it's 0. You could just set start: 0, end: "max".
Does that clear things up?