Jump to content
Search Community

Can I use splittext in reverse?

hree test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

The function I want is that when I press add button, characters are created in Splittext motion,
and when I press remove button, characters disappear in Splittext motion

Can't I use gsap.to () in Splittext?

 

See the Pen eYaMyYa by hree (@hree) on CodePen

Link to comment
Share on other sites

  • Solution

Hi there, yes, you can use 'to' with splittext. 

 

In your 'remove' tween you're trying to animate from an opacity/autoAlpha of 1 (visible) but you're not specifying that you want to animate "to" opacity/autoAlpha 0 (invisible) So when you click remove it's trying to animate from visible, to visible.

This is probably the best way to solve the problem - using control methods instead of tweens.

See the Pen MWdVrRw?editors=0110 by GreenSock (@GreenSock) on CodePen

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