Jump to content
GreenSock

agsymonds

Randomly load the chars

Moderator Tag

Recommended Posts

Just started using GSAP so please excuse the naive question.  Looking at using SplitText, like in the attached Codepen, but wanted to see how it could be altered so that when the letters appear, the order is random,  rather than linear from beginning of the quote to the end?

 

Thanks.

See the Pen JjYwVGm by robbiecren07 (@robbiecren07) on CodePen

Link to comment
Share on other sites

 

Welcome to the forum @agsymonds

 

If I understand you correctly, the advanced stagger object has you covered. Does that work like you imagined?

 

https://greensock.com/docs/v3/Staggers

 

[I justed increased the stagger value a bit in this demo to make the randomness more apparent.]

 

// simple
...
stagger: 0.1,
...



// advanced
...
stagger: {
  each: 0.1,
  from: 'random'
}
...  

 

 

 

See the Pen NWBOxjR by akapowl (@akapowl) on CodePen

  • Like 2
Link to comment
Share on other sites

Perfect, thank you. I am learning through using and looking at the code, so much appreciated help.

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