D1MK4 Posted March 12, 2022 Share Posted March 12, 2022 Hello, I've got a weird bug. When I've added ScrollTrigger for animating each sections I've also noticed that scrolling on mobile device by touching screen is really bugged after loading the page. ( I'm using IP11Pro, I just can't test the page on android device ). Do you have an idea why is something like that happening? This is deployed page: https://olgajedrzejewska.netlify.app/ The page is created with GatsbyJS. I've just put the code in global index.js and I'm returning each single component below the useEffect. This is a simple animation for each first div in section with class .animated: export default function Home({ data }) { useEffect(() => { const sections = document.querySelectorAll(".animated"); sections.forEach((section) => { gsap.fromTo( section.children, { y: "+=150", opacity: 0 }, { y: 0, opacity: 1, stagger: 0.2, duration: 0.8, ease: "easeInOut", scrollTrigger: { trigger: section, start: "-10% 76%", }, } ); }); }); return ( <Layout> <Hero /> <Info /> <About /> <AboutSecond /> <History /> <Family /> <Science /> <School /> <Cards /> <Helping /> <Numbers /> <Hours /> <Pricing /> <Contact /> <Footer /> </Layout> ); } Link to comment Share on other sites More sharing options...
Cassie Posted March 12, 2022 Share Posted March 12, 2022 Hi there! There aren't really known issues with scrollTrigger but mobile devices tend not to handle animation as well as modern desktop devices. That being said if you're just doing some simple transforms you shouldn't be having a problem. I'm afraid we don't have the resources to debug live sites though. Would you possibly be able to reproduce this in a minimal demo on codepen or codesandbox so we can take a look? Also, any more detailed information on the following would be helpful - Quote 'touching screen is really bugged' 1 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