aledoro Posted June 8, 2022 Share Posted June 8, 2022 Hello Noob question => I'm animating images on a home page and before animation plays there is a first render which flashes once then animate properly I saw the recommendations to use useLayoutEffect but it hasnt solved my problem What else would you recommand trying? Cheers ! This is the code i use : useLayoutEffect(() => { gsap.fromTo( el.current, { x: index % 2 == 0 ? "-50%" : "50%", y: "25%", opacity: 0 }, { scrollTrigger: { trigger: el.current, }, duration: small ? 1.5 : 1, ease: "circ.out", x: 0, y: 0, opacity: 1, } ); }, []) Link to comment Share on other sites More sharing options...
Cassie Posted June 8, 2022 Share Posted June 8, 2022 This article will help! Good luck. 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