Jump to content
Search Community

Stacking Splits

pietM test
Moderator Tag

Recommended Posts

Thanks for getting back! 

 

In the example, there are three discrete splitText animations sequenced by a master timeline.

 

timeline 1: 1/3 

timeline 2: 2/3

timeline 3: 3/3

 

2/3 replaces 1/3.

3/3 replaces 2/3.

Then the whole timeline repeats.

 

Rather than fading each animation out, I'd like to stack them:

So, after 1/3 completes, the text block gets pushed up to make room for 2/3 and so on. 

 

Does that make sense??

Link to comment
Share on other sites

Mmm. I'm not quite sure what you're after here but I think you might be overcomplicating. Just position them all absolutely in the same place, then animate them with transforms.

 If you want to move something by it's own height you can use yPercent.

gsap.to('elem', {yPercent: 100})


As Jack suggested if you need the height of the next element you can grab it's offsetHeight (pseudo code, incomplete)

let elems = gsap.utils.toArray('.elems')

elems.forEach((el, index) => {
  // move by the next elems height
  tl.to(elem, {
    y: () => elems[index + 1],offsetHeight
  })
  // move into place by it's own height
  tl.from(elems[index + 1], {
    yPercent: -100
  })
})


Maybe this helps? 

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