Hi!
I work on a function that should start the text animation when the trigger element is in viewport, but I would like to make it reusable. I hope I think right about these problem, just can't solve it.
I would like to use data attributes to set trigger elements for SrcollTrigger. But with the following code, the first trigger will trigger all the texts on the page and play at the same time.
I have a TextSplitter so the .title-split .char are the splitted characters.
I should find all the data-txt-wrapper elements, then start the text animation when the data-trigger element step into the viewport.
Is it possible somehow?
Thanks a lot!
// Timeline
let tl = gsap.timeline({
scrollTrigger: {
trigger: triggerElement,
start: "top 30%"
}
});
tl.from(listTxt, {
...
});
});
}