Elindo Posted September 2, 2021 Share Posted September 2, 2021 So my friend @nicofonseca created a variable called isbuttonADisabled and gave a value of false.. then called out the variable on another set of buttons to give it a true or false value.. how does JavaScript or gsap recognizes that I am looking to disable the button by simply pulling a word out of the air and giving a true or false value? what if the word was enable and you have the same true or false values? How does JavaScript recognizes between a bunch of words and know what I want? Link to comment Share on other sites More sharing options...
GreenSock Posted September 2, 2021 Share Posted September 2, 2021 It doesn't "understand" any English whatsoever. You can name variables/properties whatever you want (within the guidelines of JavaScript, like you typically can't start the name with special characters or numbers, etc.) Nico could have just as easily named that variable "pinkToadsAreCool". It's merely a holder for a value, that's it. GSAP/JavaScript doesn't try to decipher the meaning in any of the variables or property names. You might benefit from taking a course or reading some articles on basic JavaScript. I don't mean that at all as an insult or dig - I just genuinely think it might help clear some things up for you. Once you wrap your head around some of that stuff...and the GSAP API, you'll be an animation superhero in no time. For future reference, we really try to keep these forums focused on GSAP-specific questions. Please read the Forum Guidelines. Happy tweening! 👍 5 Link to comment Share on other sites More sharing options...
Cassie Posted September 2, 2021 Share Posted September 2, 2021 🐸 See the Pen NWgrqpG?editors=1111 by GreenSock (@GreenSock) on CodePen 1 6 Link to comment Share on other sites More sharing options...
GreenSock Posted September 2, 2021 Share Posted September 2, 2021 @Cassie that was my favorite post so far all year. Nicely played. 🤣 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