Jump to content
Search Community

Is there a better/shorter way to chain delayed timelines?

Loque test
Moderator Tag

Recommended Posts

Hi!

 

I would like to optimize the code you can see in the posted Pen. I basically have 5 elements that appear one after another and I use 5 different timelines to do the job. I could use a single timeline but they would appear one after another, right? Instead... I want each one to appear while the previous element is still appearing (to make it a bit more fluid). That's why I added a 0.3s delay that gets increased to 0.3 > 0.6 > 0.9 > ...

 

So this IS NOT what I want

 

And this IS what I want ... But with better code:

See the Pen YzzOyEm by LuBre (@LuBre) on CodePen

 

I am sure I didn't choose the best way to do so. What would you suggest?

See the Pen jOOvbdY by LuBre (@LuBre) on CodePen

Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...