Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
tombra

Timeline loop at end go to another image

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi

I have a looping animation.

After all the loops is finished i want to end up with a box/image that is not in the loop?

How can i do that

My start is something similar to this;

See the Pen eprVXV%23code-area by GreenSock (@GreenSock) on CodePen

 

Link to comment
Share on other sites

Hi @tombra :)

 

Welcome to the forum. 

 

I may not be understanding the question here, but couldn't you set the timeline to repeat a few times and then use an onComplete callback to show another image or play a new animation? Something like this:

See the Pen deoJzX by PointC (@PointC) on CodePen

Doe that help?

 

Happy tweening.

:)

 

  • Like 1
Link to comment
Share on other sites

That could work, thank you

But how exactly do i get the onComplete callback to show a new image?

As you understand, I am a newbie:)

Link to comment
Share on other sites

You'd need to animate or set the opacity of new image in the callback. Here's another fork where I've added a 4th frame which appears at the end of the timeline.

 

See the Pen wjajjm by PointC (@PointC) on CodePen

Happy tweening.

:)

 

  • Like 4
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.

×