GilesP Posted September 2, 2022 Share Posted September 2, 2022 Hi, I'm trying out the new matchMedia feature. I have a scroll triggered animation that reveals text sections as you scroll up and down. It checks for the direction of the scroll and inverts which element fades in or out. I am trying to only have this run on large screen sizes, which works as expected, but if you resize the window below the matched media query, it throws the error "Uncaught TypeError: Cannot read properties of null (reading 'direction')" and the tween does not get reverted. Should I be using some kind of callback or cleanup function to revert that part of the timeline Thanks! See the Pen YzLzyqZ by gpartington (@gpartington) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted September 4, 2022 Share Posted September 4, 2022 Please update to 3.11.1+ and then I'd probably do it like this: See the Pen QWrwbGd?editors=0010 by GreenSock (@GreenSock) on CodePen Is that what you wanted? 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