I have a big project that has Split Text with Scroll Trigger combined animations.
It works fine but I noticed that it is creating a lot of div/elements when I searched about the Split Text plugin.
I saw everyone is using the revert() method to make the dom element normal.
But in my case it does not work can anyone can help?
I want to make the DOM normal whenever the object is away from the view.
Here is the code, see I am using a class 'paragraph-effect' in multiple paragraph elements
const paragraphs = gsap.utils.toArray(".paragraph-effect");
paragraphs.forEach(function (p) {
const paragraph = new SplitType(p, { types: 'lines' })
gsap.from(paragraph.lines, {
duration: 1,
y: 25,
opacity: 0,
stagger: 1,
scrollTrigger: {
trigger: p,
start: "top bottom",
end: "bottom center",
scrub: true
}
}
);
});