Jump to content
GreenSock

Eugene Rayner

repeat animation loop

Moderator Tag

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

Hello,

 

Simply trying to have my "clouds" (the red boxes that say cloud) to repeat.

Currently, they are repeating, but the animation doesn't end (the cloud doesn't make it to the other side of the screen)

 

There are about 5 different clouds on the page and I want them all to move at varying speeds, and then loop once they can no longer be seen on the page.

 

Any help greatly appreciated.

Cheers!

See the Pen MmzRYb by erayner (@erayner) on CodePen

Link to comment
Share on other sites

Hi erayner_45092,

 

there are a lot of clouds.

 

If you mean the 5 "parallax-bg1"-clouds should tween only once just tween without "repeat:-1".
"repeat:-1" is for repeating indefinitely.

 

In the forked pen I have changed the positions of these clouds:

 

See the Pen XRyQqE by mikeK (@mikeK) on CodePen

 

 

Happy tweening
Manfred

Link to comment
Share on other sites

Hi Mikel,

 

I mean that they should tween indefinitely, but I want them to tween until they are off the page ie the clouds go from 1 side of the screen, to the other side of the screen.

 

Cheers

Link to comment
Share on other sites

Hi erayner_45092,

 

like this one?: 

 

See the Pen LyXoYK by mikeK (@mikeK) on CodePen

 

Happy tweening ...

 

Link to comment
Share on other sites

Yes that looks good.

Do you know how we can have the clouds not all end up at the same position at the same time?

ie more of a cloud effect rather than all racing to the same position?

Cheers

  • Like 1
Link to comment
Share on other sites

 

Ohhh, you can play a lot of things.

See the Pen VbVOqm by mikeK (@mikeK) on CodePen

 

For example:

See the Pen VbVOqm by mikeK (@mikeK) on CodePen

 

Sorry, the pen are double. Can´t delete one ...

 

Kind regards

Manfred

 

  • Like 4
Link to comment
Share on other sites

This thread may be of interest to you as well.

 

Happy tweening.

:)

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

@Novamation MEDIA Maybe it's because it's using jQuery? Or maybe because it's using the window object which doesn't exist? Maybe if you can provide more details about your setup someone on the forum could help.

Link to comment
Share on other sites

Thanks for responding.  I see that the problem was the use of double quotes.  It was simply an oversight.  

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.
×