Mir Moc Posted April 14, 2022 Share Posted April 14, 2022 Hi everyone, I'm trying to add a class of .selected to the nav links whenever each of the sections enters the viewport, with gsap, but lacking basic Javscript knowledge so here for your help Made a codepen for it. Thanks See the Pen xxEvrgR by mirmoc (@mirmoc) on CodePen Link to comment Share on other sites More sharing options...
GreenSock Posted April 14, 2022 Share Posted April 14, 2022 Hi @Mir Moc. I assume you're looking for something like this?: See the Pen wvpYrJX by GreenSock (@GreenSock) on CodePen 3 Link to comment Share on other sites More sharing options...
Mir Moc Posted April 14, 2022 Author Share Posted April 14, 2022 7 minutes ago, GreenSock said: Hi @Mir Moc. I assume you're looking for something like this?: Thank you so much! Exactly this. 1 Link to comment Share on other sites More sharing options...
Mir Moc Posted April 22, 2022 Author Share Posted April 22, 2022 On 4/14/2022 at 5:37 PM, GreenSock said: Jack, how do I reuse the function when to add something to the event listener? Using barba to load – http://mirmoc.com/ From the project page I want to go back to the main page, then run to the respective triggers you created. I think two options, either to do it with if else in your function, or to update the function in the barba hook where I go back to main page. Hi @Mir Moc. I assume you're looking for something like this?: Link to comment Share on other sites More sharing options...
GreenSock Posted April 22, 2022 Share Posted April 22, 2022 Sorry, I don't really understand your question - if you still need some help, please provide a minimal demo with a GSAP-specific question and we'll do our best. Thanks! 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