Jump to content

Roman Kovalev

Too many of "from" tweens

Go to solution Solved by Dipscom,

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

Have faced that need to work with a multiple "from" tweens with a same element.

Of course that gave me a wrong experience with using such a "structure", like:

tl.from(Intro_logo, .5, {opacity: 0})
//bla bla other tweens
tl.to(the.Intro_logo, 0.25, {opacity: 0}, 'second_frame_start')
//bla bla other tweens
tl.set([Copy, Intro_logo], {className:"+=next-step"})
//bla bla other tweens
tl.from(Intro_logo, 0.75, {opacity: 0, x: '-30%'})

will give me the result that my Intro_logo will have on the very beginning of the animation the positioning of x: -30% (as example).


How can I figure it out? Because, with my current job I will have to challenge it always. Thanks in advance!

Link to comment
Share on other sites

  • Solution

As a rule of thumb, you should limit using .from() tweens to only the first tween of the element, it really can cause confusion and not pleasant behaviour.


However, if you must work with it, for whatever reason that might be, you just need to grasp the immediateRender property and how GSAP works with it.


Carl does, as always, a great job of explaining it all in the following video: 


It should set you on your path.

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