Jump to content
Search Community

useGSAP, matchMedia and timelines

Ano test
Moderator Tag

Recommended Posts

I have spent almost 2 days trying to do find a way to do this,

 

1) How do I utilize the useGSAP method  with the matchMedia method - I am trying to have two different animations for large screens and small screens. I tried to use matchMedia() by itself and its not working, it doesn't produce any animation at all

See the Pen mdgewOM?editor by thebrain365 (@thebrain365) on CodePen

Link to comment
Share on other sites

The syntax of the media you're trying to match is the same as the CSS spec, so you need to make sure you write it like you would write it in CSS. 

 

The useGSAP() is a new plugin special made for use in React, so if you use React or its other frame works, check out our Stackblitz starter templatesReact (please read this article!), Next. Hope it helps and happy tweening! 

 

See the Pen gOyaxQV?editors=0010 by mvaneijgen (@mvaneijgen) on CodePen

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...