Jump to content
Search Community

Michal_Ant

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Michal_Ant

  1. Thanks for super fast response! 

    I just installed the package and tested it. 

    Now it works, but still have issues with certain toggleActions values

     

    function Component({delay}){
    
      const target = useRef()
    
       useEffect(()=>{
          gsap.registerPlugin(ScrollTrigger)
          gsap.to(target.current, {opacity: 1, visibility: 'visible', y:0, duration: 1, delay: delay,  scrollTrigger: {
              trigger: target.current, 
              start: "top 90%",
              toggleActions: "play none none none",  // this works perfectly
              //toggleActions: "restart none none none", // this doesn't delay animation
          }})
        },[])
      return(
      <ContainerAnimated ref={target}>
        // ... other child components
      </ContainerAnimated>
      )
    }

     

    Would be greatful for any hint

     

    *edited: delay value is comming from props and it is a number

×
×
  • Create New...