Jump to content
Search Community

pause(0) not resetting all properties

kitepwr 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

Hey guys,  this one's got me stumped.  I have a timeline that starts by making an element visible.  When pause(0).clear() is run, the element is still visible.  Why?  And, how do I make it go back to it's previous state -- i.e. not visible?  The codePen shows an example. 

 

Thanks,

Darrin

 

P.S. I'm breaking my own rule by asking 2 questions in 2 weeks in a forum.  Apologies for that.

See the Pen JrrrWK by kitepwr (@kitepwr) on CodePen

Link to comment
Share on other sites

Yep, that works and is the kind of thing I was looking for.  Thanks!

 

But.... is there a way to accomplish that without the explicit reference (to #t1) in clearTL()?

In my code, clearTL() can be called after any of 100 different page animations. 

Some will need a clearProps for specific (and varying) fields; others will not. 

The best I've come up with thus far is to use something like ...
 

in run() --> tl.data = {clearProps: <array of elements>};

in clearTL() --> if (tl.data.clearProps) TweenList.set(tl.data.clearProps,{clearProps: "all"});

 

Is it ok to use .data like this? 

Is there another/better way to do this?

Link to comment
Share on other sites

Nice Blake,  I will implement this tonight and then consider this presentation app complete.  Just 1 day ahead of my deadline. LOL

There is much about it that is very, very crude.  But other parts are pretty cool.  GSAP has been a huge part of it.  Many thanks to everyone at Greensock.

 

Darrin

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