Jump to content
Search Community

Using different eases on yoyo: true

SlimMarten test
Moderator Tag

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

I am having a simple tween formTo().

TweenMax.fromTo(element, duration,
			{
				attr: {
					transform: `translate(0,${expander+offsetY})`
				},
			},{
				attr: {
					transform: `translate(0,${ expander*(-20 + offsetY)})`
				},
				ease: Elastic.easeOut.config(1, 0.5),
				yoyo: true,
				repeat: -1,
			}
		);

I have defined a default Elastic easing in the tweens property here. What I am trying to achieve now, is to give my tween another easing when it plays reverse.

 

Is that possible at all?

 

Thanks in advance

Link to comment
Share on other sites

My gut feeling is "not possible".

 

You can achieve something like that with two tweens, one for the animation in, one for the animation out. With a delay on the second one.

 

You would set some variables to use in your tweens so that you don't have to type everything twice and it would make amends easier.

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