Jump to content
Search Community

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

Posted

Hi,

How do I animate this ball up and down smoothly.

I'm using fromTo but i don't know where to put "repeat:-1"

See the Pen ZrZqEJ by stagnax (@stagnax) on CodePen.

Posted

Hi @Stagnax :)

 

This should work for you.

 

var tl= new TimelineMax({repeat:-1, yoyo:true});
tl.fromTo("#char", 1, { y: 100 }, { ease: Power0.easeNone, y: -100 });

 

Happy tweening.

:)

 

  • Like 3
Shaun Gorneau
Posted

As a property of TimelineMax();

 

You can also "yoyo" the tween to get rid of a fromTo

 

var tl= new TimelineMax({repeat:-1, yoyo: true});

 

See the Pen yvrRxK by sgorneau (@sgorneau) on CodePen.

 

  • Like 6
Shaun Gorneau
Posted

Gahhhh!!!! Sorry @PointC ... just seconds after you :/

  • Like 3
  • Haha 1
Posted

Again thank you Craig, I'm learning a lot form the past few days. :)

  • Like 3

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