Jump to content

Mustafa Şatıroğlu

Next or Prev button and go to section

Moderator Tag

Recommended Posts

@Cassie  Hi everyone. I have a problem (

See the Pen xxEQNBB by GreenSock (@GreenSock) on CodePen

) in the codepen link I sent below, I want to add prev and next buttons to each section field. And when I click these buttons, I want it to jump to the next or previous section field. Can you help with this?

Link to comment
Share on other sites

hello my friend. @GreenSock I made a few updates. I added the progress bar. Everything is going great so far. Gsap is really fun. 🥰


I have one last question. I want the active class to be added to the menu items that are above the scroll, and to remove the active class from the menu items unless there is a scroll.


So let me give an example. Let's say the user went to Section 3. In this case, the active class will be added to the first 3 of the above menu items. In this case, let's say it went to section 2 by scrolling. This time, the active class will be added to the first 2 of the above menu items.

I hope I was able to explain. I tried a lot, but I'm very new to gsap and couldn't do it.


See the Pen LYdwmQq by mustafasatiroglu (@mustafasatiroglu) on CodePen

Link to comment
Share on other sites

@Mustafa Şatıroğlu It might be better to post this in the GSAP forum as opposed to the freelance & jobs forum. There are multiple ways you could go about adding and removing classes based on scroll. While I don't have an answer for you, there are some really excellent developers on the main forum that can definitely help.

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.