Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
paro

Cannot read properties of undefined (reading 'DOM')

Go to solution Solved by mvaneijgen,

Recommended Posts

Hi there,

Cannot read properties of undefined (reading 'DOM')

I got this error while working on my project, i couldn't find a solution for that. What i am missing here? 

See the Pen NWybXmy by tw_parodia (@tw_parodia) on CodePen

Link to comment
Share on other sites

  • Solution

I've created an arrow function of your matchMedia query and that seems to work.`this.` will otherwise be scoped to its parent function 

"(min-width: 800px)": function() {

 

"(min-width: 800px)":() => {

See the Pen MWQbQXg?editors=0011 by mvaneijgen (@mvaneijgen) on CodePen

  • Like 2
  • 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.
×