devin1229 Posted May 1, 2022 Share Posted May 1, 2022 I was wondering if there's anyone out there that can peep what I have to see why it's not working? Basically I'm just playing around and would like a box to animate to different x positions depending on the size of the window (to prevent overflow/contain the animation to the parent). I'm not getting any script errors or anything, so I'm not sure what the issue is. Does matchMedia only work with advanced timelines? See the Pen mdXdmqM by devin1229 (@devin1229) on CodePen Link to comment Share on other sites More sharing options...
Solution GreenSock Posted May 1, 2022 Solution Share Posted May 1, 2022 The main problem is a typo - you had a lowercase "s" in ScrollTrigger.create(...) // BAD scrollTrigger.matchMedia(...) // GOOD ScrollTrigger.matchMedia(...) Beware that the way you set things up with your media queries, if the viewport is between 600px and 959px, neither animation will run. I hope that helps. 1 Link to comment Share on other sites More sharing options...
devin1229 Posted May 1, 2022 Author Share Posted May 1, 2022 16 hours ago, GreenSock said: The main problem is a typo - you had a lowercase "s" in ScrollTrigger.create(...) // BAD scrollTrigger.matchMedia(...) // GOOD ScrollTrigger.matchMedia(...) Beware that the way you set things up with your media queries, if the viewport is between 600px and 959px, neither animation will run. I hope that helps. Hahaha... it was late! 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