Jump to content
GreenSock

Eraze86

Members
  • Posts

    3
  • Joined

  • Last visited

Eraze86's Achievements

  1. thank you so mush för the help. But when i try any of thos alternatives i get tl.current error, is undefinde.
  2. I have made the menu. it works fine when its opend but when i close it i cant get it to work the way i want to. it should be reversed interesting-microservice-qtdzxd - CodeSandbox
  3. const tl = gsap.timeline() useEffect(() => { if (isOpen) { tl.to([toggle.current], { height: "18rem", ease: "none" }) tl.to([link.current], { delay: 0.2, opacity: 1 }) }else{ console.log("close") } }, [isOpen, tl]) im trying to make my menu open och close in the same way. but at soon as i put any code more then console.log in the else {} it gives me "Cannot read properties of null" i dont understand why? ive tryed tl.reverse and writing tl.to code but it always gives me the same error. i have also tryed if else, and if(!isOpen) but gives me the same Any input? the first code works when i press the button to open the meny, i can change it aswell so it only works when i close the button.
×