Jump to content
GreenSock

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

Smooth Repeat Vertical motion

Recommended Posts

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

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

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

  • Like 3
Link to post
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.

×