jQuery(function() { var container = gsap.utils.toArray('.text-anim').forEach((title, index) => { var lineChild = new SplitText(title, { type: "lines", linesClass: "lineChildContent" }); var titleLines = lineChild.lines; //an array of all the divs that wrap each lines // On anime chaque ligne sur le scroll gsap.from(titleLines, { duration: 1.2, autoAlpha: 0, ease: Power4.out, stagger: .25, scrollTrigger: { trigger: title, start: "center bottom", end: "top top" //scrub: 1 } }); }); });