Jump to content
GreenSock

ajnglagla

"ReferenceError: assignment to undeclared variable color" error.

Recommended Posts

I am having this error when I try to change the color of a text. Do you have any idea why? Do I need extra plugin library for that? I am using 1.18.2/TweenMax.min.js

 

Error:

ReferenceError: assignment to undeclared variable color
  color = {h:0, s:50, l:50};

Screenshot:

 

QAMYy5E.png

 

The code that gives me error:

color = {h:0, s:50, l:50};

See the Pen YqLBNE by jonathan (@jonathan) on CodePen

Link to comment
Share on other sites

I have solved my problem with putting "var" front of it. Thank you

var color = {h:0, s:50, l:50};
  • Like 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.
×