Jump to content
Search Community

Animating in splitText after animating out

paulfitz99 test
Moderator Tag

Go to solution Solved by Jonathan,

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 trying to use Greensock's split text plugin to animate text in on one click and out on another. It is animating in as I want, and working perfectly. However, I am having difficulties animating the text out.

 

It is animating out as I want, however, when the animation is complete, and i try and animate the text back in as originally it no longer works.

 

I have created a code pen here to demonstrate the issue I am having.

 

I have attempted to use the invalidate method http://greensock.com/docs/#/HTML5/GSAP/TweenLite/invalidate/ however it didn't work. I also tried clearProps: all, which didn't work either.

 

See the Pen bwvyBr by Pau1fitz (@Pau1fitz) on CodePen

Link to comment
Share on other sites

  • Solution

Hello paulfitz99, and Welcome to the GreenSock Forum!

 

One way is to use TimelineMax and just play() on animateIn() and reverse() the timeline when animateOut().

 

See the Pen ALyGYQ by jonathan (@jonathan) on CodePen

 

The above is just one way.. it could have been done in many ways i was just showing you one way with the existing code you already had.

 

:)

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