Share Posted August 26, 2018 (I am trying to use two separate timelines for open and close animations. I have two tests set up which have the same error.) I pass references to timelines to my callback functions. When I pass them as timeline instances, the callback function reports that they are undefined. I can work around it by passing the names of the timelines as strings but that is clumsy. What am I missing? You'll need to have the console open to see the errors. They also manifest themselves after a few toggle actions as timelines don't get reset properly. See the Pen OoModO by MSCAU (@MSCAU) on CodePen See the Pen OoModO by MSCAU (@MSCAU) on CodePen Link to comment Share on other sites More sharing options...
Author Share Posted August 26, 2018 Hmm. I think it's because at the time I'm setting up the callback for tl4, tl5 hasn't been declared yet and the tl4 callback expects tl5 as a parameter. I'm happy to take suggestions on how best to structure this! Link to comment Share on other sites More sharing options...
Share Posted August 26, 2018 Here is how you can do it so you won't have to pass parameters or even need callback. See the Pen qMbgON?editors=0010 by Sahil89 (@Sahil89) on CodePen 6 Link to comment Share on other sites More sharing options...
Author Share Posted August 26, 2018 Thanks, Sahil! You've been a great help. 2 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