Share Posted July 15, 2022 I am struggling to figure out how to write the most efficient code with toArray and FLIP and hoping someone can point me in the right direction. I'm using toArray to find all classes for a set of divs, then using FLIP to animate the contents of those divs via toggleclass on click. The contents are child elements, which I'm identifying within each instance using JQ find. My problem is that I'd like to write one Flip.getState, one toggleClass, and one Flip.from statement to cover all the child class animations, but my coding skills are too shaky to know how to do that since the class names are within the toArray. The linked CodePen is a working example using inefficient, duplicate statements, with a comment showing those I'd like to consolidate. Apologies, I know this is probably more of a pure JS/JQ question than GSAP-specific. Thank you! See the Pen poLNMXo by TimTh (@TimTh) on CodePen Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now