Jump to content
Search Community

Quickly scale multiple elements up-and-down

marcamos test
Moderator Tag

Go to solution Solved by PointC,

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! I'm working on my second-ever GSAP feature and, naturally, I'm a little stumped.

 

I've succeeded in getting mostly what I want (see the associated Codepen demo), but I believe I'm being stumped by the…

yoyo:true

…part. In the Codepen demo, it's "yoyo'ing" only after it scales-up all of the squares, but what I'm aiming for is each square scaling up-and-down individually, starting at the first, then second, then third, and so-on. (Does that make sense?)

 

Many thanks for any tips you can provide!

See the Pen qZWBPW by marcamos (@marcamos) on CodePen

Link to comment
Share on other sites

  • Solution

Hi marcamos  :)

 

Nice demo. I think you can get what you need by putting the yoyo on the tween rather than the timeline.

var tl = new TimelineMax();
tl.staggerFromTo('.box', 0.5, {scale:1}, {scale:1.1, repeat:-1, yoyo:true}, 0.1);

Here's a fork of your pen with that change.

See the Pen wGwvRp by PointC (@PointC) on CodePen

 

Hopefully that helps a bit. Happy tweening.

:)

 

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