Share Posted August 7, 2019 Hi! In the codepen example - I have a slideshow with a small function called "animateSlide" that just maked the h1 tag red. At the moment it's happening very slow eventhough I've set it to one second. Any ideas why? See the Pen aeqMMY by daniel-hult (@daniel-hult) on CodePen Link to comment Share on other sites More sharing options...
Share Posted August 7, 2019 That's happening because you keep adding tweens to the end of the timeline. Each click adds a one second tween in your animateSlide() function. You may want to use timeline.clear() at the beginning of that function. Happy tweening. 2 Link to comment Share on other sites More sharing options...
Author Share Posted August 7, 2019 Thanks for the reply! I tried implementing that, but then it doesn't do the animation when I click again. I want the animation to run each time I click Link to comment Share on other sites More sharing options...
Share Posted August 7, 2019 How about this: timeline.fromTo(nextHeading, 1, {color: 'white'}, {color:"red"}); Does that help? 1 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