mixpofo Posted October 1, 2023 Share Posted October 1, 2023 Hello, I am encountering an issue with ScrollTrigger and Lenis on the mobile version of my project. The scrolling experience is laggy and not smooth, whereas everything operates seamlessly on the desktop version. This is my code : useEffect(() => { const lenis = new Lenis({ duration: 2, easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), infinite: false, }); lenis.on("scroll", ScrollTrigger.update); gsap.ticker.add((time) => { lenis.raf(time * 1000); }); gsap.ticker.lagSmoothing(0); ScrollTrigger.normalizeScroll(true); // Nettoyage lors du démontage return () => { lenis.off("scroll", ScrollTrigger.update); }; }, []); Thanks !! Link to comment Share on other sites More sharing options...
GreenSock Posted October 1, 2023 Share Posted October 1, 2023 It's very difficult to diagnose without a minimal demo, but maybe try: Disable Lenis on mobile. You could wrap the Lenis code in if (!ScrollTrigger.isTouch) {...} If you're using Lenis, try not enabling the normalizeScroll() option. 🤷♂️ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now