Eraze86
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by Eraze86
-
-
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
-
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.
timeline reverse wont work. gets "Cannot read properties of null"
in GSAP
Posted
thank you so mush för the help. But when i try any of thos alternatives i get tl.current error, is undefinde.