Jump to content

Search In
  • More options...
Find results that contain...
Find results in...
Patrick Rijkee

Width and height check in ScrollTrigger.matchMedia()

Go to solution Solved by tailbreezy,

Recommended Posts

Hello everyone,


I have an animation that needs to display only above 992px width and 700px height.

however it seems i cant add more than one condition to matchMedia.


What is the (proper) way to do this?


(I hope you dont mind i used your matchMedia demo as a starting point for my codepen)



Patrick Rijkee

See the Pen MWbBLYW by parpar78 (@parpar78) on CodePen

Link to comment
Share on other sites

  • Solution



It uses the css @media syntax:


	"(min-width: 800px) and (min-height: 800px)": function() {}


  • Like 4
Link to comment
Share on other sites

This is strange, in my sass i have to use comma.

because "and" seems to split the media query to be 2 separate queries. but perhaps this is Sass specific.


thanks for the help. this seems to work in GSAP.

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.