Loust Posted February 22 Share Posted February 22 Hello community! So here's the thing: I have a window.resize event where I apply a state as true or false based on the screen size to hide and show elements. However, when I resize the window, the ScrollTrigger doesn't retrigger. I'm using React with Locomotive Scroll. During the resize event, I destroy (if that's the right logic) all the ScrollTriggers, then I do a ScrollTrigger.refresh(). My ScrollTriggers have invalidateOnRefresh: true, but nothing seems to work. So, I'm lost. If you need a minimal demo without issues, I can provide one. Thanks. Link to comment Share on other sites More sharing options...
GreenSock Posted February 22 Share Posted February 22 Yeah, a minimal demo would be super duper helpful. But this sounds like a great case for gsap.matchMedia()! https://gsap.com/docs/v3/GSAP/gsap.matchMedia() And since you're using React, definitely check out https://gsap.com/react 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now