Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Newbie

About Daniel2024

  • Rank
  1. ok, thanks First timeline is running , but the second one isn't . What is wrong in my code? / second timeline for reverse method const secTimeLine = new TimelineLite({ paused: true }); secTimeLine.to('.slide-container', 0.5 , { opacity: 0, ease: Ease.easeIn }); function closeMenu(){ tl.play(); } // event document.querySelector('.menu-icon').addEventListener('click', animateNavbar); // animation status const isAnimated = false; const isOpen = true; function animateNavbar(e){ // check for false if (isAnimated.current) { return; } // set to true isAnimated.current = true; if(isOpen.current) { openMenu() } else { closeMenu() } }
  2. Yes, got it. So I have to delcare my openMenu() and my closeMenu(), where i insert my timelines outside of the toggleMenu function , right ? const isOpen = useRef() I can call useRef however I want , right?
  3. I was going through the code , but I didn't get it.. I am not really familiar with react.. I changed my code. How can I add the second timeline for the reverse method? document.querySelector('.menu-icon').addEventListener('click', animateNavbar); function animateNavbar(e){ tl.reversed() ? tl.play() : tl.reverse(); }
  4. if I want to add a second timeline for the reverse method , how can I do it? So first i am running the first timeline and when i click to close the menu I want to add a different timeline..
  5. @ZachSaucier , appreciate your help. Thank you 😃
  6. Hello guys, im trying to animate a menu with TweenMax. If I click the menu-icon , the animation works properly and menu is viewable , but when i click again the animation doesn't work. Thank you in advance. Regards Daniel