Share Posted February 11, 2022 I have been trying to create a navbar animation where the navbar comes from top when clicked and goes back the exact same way but so far that is not how my code is behaving. On clicking the back button the navbar simply disappears. Here is the codesandbox link https://codesandbox.io/s/misty-star-ncl3z Link to comment Share on other sites More sharing options...
Share Posted February 11, 2022 Hey @Skaiii, Welcome to the GreenSock Forum. Here an example which could be helpful. See the Pen rNWWMGz by mikeK (@mikeK) on CodePen Happy tweening ... Mikel Link to comment Share on other sites More sharing options...
Author Share Posted February 11, 2022 The solution didn't work in a way as I am using nextjs and it becomes imperative to initialize the timeline in useEffect which runs the animation as the page loads and when I put the timeline out of useEffect, I get the error of property of querySelectorAll undefined as the hasn't loaded yet. What should I do? Link to comment Share on other sites More sharing options...
Share Posted February 11, 2022 16 minutes ago, Skaiii said: What should I do? Go through our React guides. 😉 https://greensock.com/react 2 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