We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I'm trying to split my content into lines but it appears to be splitting my paragraph instead. Any advice greatly appreciated please.
I'm using version 0.3.3 and Next.js version 13.2.4
Here's the code I'm using to split the text:
useEffect(() => { if (textRef.current) { gsap.registerPlugin(ScrollTrigger) const newText = new SplitType(textRef.current, { types: 'lines, words' }) newText.lines.forEach((target) => { gsap.to(target, { backgroundPositionX: 0, ease: 'none', scrollTrigger: { trigger: target, markers: true, scrub: 0.5, start: 'top bottom', end: 'bottom center', }, }) }) } }, [textRef])
The text was updated successfully, but these errors were encountered:
Can you create a live example on code sandbox?
I can't really tell what's happening without seeing the complete code.
Sorry, something went wrong.
If you can't create a live demo, include the full code of that react component, including the html element that the ref is attached to.
It would also help to see the generated html in the web inspector after the split text function runs.
useEffect(() => { if (textRef.current) { gsap.registerPlugin(ScrollTrigger) const newText = new SplitType(textRef.current, { types: 'lines, words' });
gsap.to(newText.lines, { backgroundPositionX: 0, ease: 'none', scrollTrigger: { trigger: newText, markers: true, scrub: 0.5, start: 'top bottom', end: 'bottom center', }, }) }
}, [textRef])
No branches or pull requests
Hi,
I'm trying to split my content into lines but it appears to be splitting my paragraph instead. Any advice greatly appreciated please.
I'm using version 0.3.3 and Next.js version 13.2.4
Here's the code I'm using to split the text:
The text was updated successfully, but these errors were encountered: