Jump to content
GreenSock

aleangelico

How to change other properties while animating

Go to solution Solved by Shaun Gorneau,

Recommended Posts

Hi

 

I want to move an object during 6 seconds, and make changes to some properties (like opacity and rotation) while moving.

In this code I used "-=2", etc, expecting to trigger the change 2 seconds before the first 6 seconds finishes, but it starts after the first animation finishes.

Is this possible? to have a "background" animation and make changes during it?

 

 

See the Pen oNopyEa by aleangelico (@aleangelico) on CodePen

Link to comment
Share on other sites

  • Solution

Hi @aleangelico,

 

Yes absolutely. But I'm unsure what you're trying to achieve ... you have what appears to be conflicting stuff going on. Here is an example of properties being tweened during the duration of a longer tween.

 

See the Pen rNYprdo?editors=0010 by sgorneau (@sgorneau) on CodePen

 

 

  • Like 2
Link to comment
Share on other sites

Hey @aleangelico,

 

Welcome to the GREENSOCK Forum.

 

1 hour ago, aleangelico said:

expecting to trigger the change 2 seconds before the first 6 seconds finishes, but it starts after the first animation finishes.

 

The interaction of time, duration and ease is relevant here.

Here is a small example:

 

See the Pen gOXodJQ??editors=1010 by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

 

 

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