Jump to content
Search Community

Text Animation - gsap3

jollygreen test
Moderator Tag

Recommended Posts

I can animate text with the following:

var headline = document.querySelector('#headline');
var splitHeadline = new SplitText(headline, {type:'words,chars'});
var chars1 = splitHeadline.chars; 

gsap.from(chars1, {duration: 0.5, autoAlpha:0, ease:  SteppedEase.config(6), stagger: 1 / 10 })

However, if I change "autoAlpha:0" with "visibility:'hidden'" to remove the opacity, the text doesn't animate.  I'd appreciate your expertise.

 

 

Link to comment
Share on other sites

If I understand correctly, you'd like to tween "visibility". But, visibility isn't a tweenable property because either it is (visible) or it isn't (hidden), there are no states in between.

 

Taking a step back, what is it you're trying to achieve that leads you to believe visibility: hidden; is the answer?

  • Like 2
Link to comment
Share on other sites

7 minutes ago, jollygreen said:

@Shaun - We can animate the text with visibility:hidden using https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js

@jollygreen I'm totally confused. Can you show us an example of that? I can't imagine how that'd work. Like @Shaun Gorneau said, "visibility" isn't an animatable property (what would the halfway-between value be exactly? visibility: "kinda"? :) ) I'm sure we're just misunderstanding something about what you're saying/wanting, so it'd be super helpful to see a reduced test case, perhaps in codepen? 

 

And why exactly are you NOT wanting to use autoAlpha? The entire point of that special property is to handle both opacity and visibility for you. So it seems perfect for the effect you described, but again, I must be missing something. 

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