Jump to content


Smooth Repeat Vertical motion

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


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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

  • Like 3
Link to comment
Share on other sites

@Shaun Gorneau - great minds think alike and type at nearly the same speed.:)


@Stagnax - you're welcome. Happy to help. :)



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