How can I add a class to an element with GSAP3? In the code I'm working on, I need to add and remove a class using GSAP. Below is an example of what I'm trying to accomplish. Thanks for you help.
See the Pen WNPPWKP by jollygreen10 (@jollygreen10) on CodePen
In very, very old versions of GSAP (before 2019), GSAP did offer the ability to animate between classNames but we removed that in 3.x because:
It's wasteful. In order to do it effectively, GSAP would literally have to compare EVERY possible CSS property between the starting state and the ending state and isolate just the ones that changed and then animate between those. It's far, far better to just animate properties directly (have the developer specify which properties/values should cha