Capítulo 385 de 411

Chapter 385: SplitText.create

Core Idea

Creates and returns a standalone SplitText instance

Key Concepts

  • vars: Object

Code Examples

SplitText.create(".headline", {
  type: "lines,words",
  linesClass: "line",
  wordsClass: "word++",
  autoSplit: true,
  onSplit: (self) => {
    return gsap.from(self.lines, {
      yPercent: 100,
      opacity: 0,
      stagger: 0.1
    });
  }
});
  • What it demonstrates: typical usage of SplitText.create in a GSAP animation.

Key Takeaways

  1. vars: Object

Connects To

  • see the main SplitText page.: related GSAP concept