Jump to content
GreenSock

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

Play timeline on templated elements

Go to solution Solved by Carl,

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

Hi,

Here my problem,
I use a small semantic template engine (transparency) and I can't make my TimelineMax works on elements that being templated.
I guess I done something wrong, but I don't manage to make work my "staggerTo(.MyClass)" that is into my timeline and don't find any fonction to reload the selector or something like that.
I give you a codepen of the problem.
 

If any of you have sugestions :)

Allan

See the Pen myoyMb by anon (@anon) on CodePen

Link to comment
Share on other sites

Hi teekla  :)

 

There isn't any problem , but you should to write/run GSAP Tweens after the transparency data render .

 

pls check this out : 

See the Pen wBOBqG by MAW (@MAW) on CodePen

  • Like 1
Link to comment
Share on other sites

  • Solution

Hi and welcome to the GreenSock forums.

 

The API does not support dynamically updating / reloading the target(s) of a tween.

 

The best solutions I can think of at the moment are to

 

  1. rebuild the timeline when you know a new DOM element is created
  2. create a single tween for the new DOM element and insert it into the timeline where it should go, do not try to modify an existing staggerTo().
  • Like 2
Link to comment
Share on other sites

Thanks you to both of you for your answers,

I choose the second solution and now it works perfectly :)

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