Jump to content
Search Community

Repeating fromTo without using Timeline

friendlygiraffe test
Moderator Tag

Go to solution Solved by Carl,

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

I'm trying to create a simple looping fade, without using a timeline or onComplete function calls.

 

is this possible?

 

This doesn't work, but I'd like something similar to this. Fade from 0 and then back to 0 with a 2 second delay?:

TweenMax.fromTo("#circle", 0.5, {autoAlpha:0}, {autoAlpha:0, repeat:-1, repeatDelay:2});

Thanks

See the Pen eWZQLg by friendlygiraffe (@friendlygiraffe) on CodePen

Link to comment
Share on other sites

A timeline might be the most intuitive way but technically you could use a SlowMo with yoyoMode set to true (to make it end where it begins) like

 

TweenMax.fromTo("#circle", 1, {autoAlpha:0}, {autoAlpha:1, repeat:-1, yoyo:true, repeatDelay:2, 
ease:SlowMo.ease.config(0.01, 0.7, true)});

 

 

http://codepen.io/GreenSock/pen/pPyBRP?editors=0010

 

SlowMo: https://greensock.com/docs/#/HTML5/GSAP/Easing/SlowMo/

 

A CustomEase would give you more configuration options like: https://greensock.com/ease-visualizer?CustomEase=M0,0%20C0,0%200.504,0.988%200.504,0.988%200.504,0.988%201,0%201,0

  • Like 2
Link to comment
Share on other sites

That's great to know. Thanks a lot Carl

 

A timeline might be the most intuitive way but technically you could use a SlowMo with yoyoMode set to true (to make it end where it begins) like

 

TweenMax.fromTo("#circle", 1, {autoAlpha:0}, {autoAlpha:1, repeat:-1, yoyo:true, repeatDelay:2, 
ease:SlowMo.ease.config(0.01, 0.7, true)});

 

 

See the Pen pPyBRP?editors=0010 by GreenSock (@GreenSock) on CodePen

 

SlowMo: https://greensock.com/docs/#/HTML5/GSAP/Easing/SlowMo/

 

A CustomEase would give you more configuration options like: https://greensock.com/ease-visualizer?CustomEase=M0,0%20C0,0%200.504,0.988%200.504,0.988%200.504,0.988%201,0%201,0

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