Jump to content
GreenSock

Mr Pablo

Creating several tweens & timelines, need to hide all assets on creation

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 looping through a load of data to build up several assets (images and text).

 

They are all added to tweens and then timelines, and are currently all visible on the page.

 

I need to make sure that they are not visible until their respective timeline actually plays. I tried using immediateRender:false but that didn't seem to do anything.

 

I cannot rely on the assets having their opacity set to 0, as it may be the case the animation doesnt require the asset to behave that way.

 

So, I need a way to make sure my assets are "hidden" after they are created and added to tweens, then timelines.

 

 

Link to comment
Share on other sites

You can set their visibility to hidden on creation

TweenLite.set(elem, {visibility:"hidden"});

Inside your timeline set the visibility to "visible" with immediateRender:false

timeline.set(elem, {visibility:"visible", immediateRender:false})

if you can't get it working please provide a very simple codepen or jsfiddle example. We don't need to see any complex data parsing... the simpler the better.

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