Jump to content
Search Community

Gasptrigger and Animation challenge with variable rows

Nextleveles test
Moderator Tag

Recommended Posts

 
I am trying to get an effect with greensock for the text in a slider were letters come from bottom to top like in "rocersa_com" homepage.  

 

The challenge is that admin will add the text in the wordpress panel, so I dont know in prior if there will be, 1, 2, 3, 4 or more lines, that comes with this structure.

 

I will launch this effect with the gasptrigger, but need some help in getting the effect work.

 

<h1 class="animate-fade">
<span class="color-white fnt-dmsans">LOREM</span>
<span class="color-white fnt-newyork">IPSUM</span>
<span class="color-white fnt-dmsans">SIT AMET</span>
<span class="color-red fnt-newyork">Whenever</span>
</h1>

 

 

   
Link to comment
Share on other sites

Could you create a minimal demo, this really helps people give you better answers.

 

I don't see what effect you are talking about on rocersa.com, there are multiple, but what your describing sounds a lot like a tutorial @Carl made

 

Also the Stagger property doesn't care how many or how little elements there are, so if you do the following each `span` will animate in `0.2` seconds after each other.

gsap.form(document.querySelectorAll('.animate-fade span'),{opacity: 0, stagger: 0.2})

 

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