Jump to content
GreenSock

superbenj

navigation same page

Recommended Posts

I'm using the amazing scrollSmoother. but it seems to have a problem using the navigation on the same page. When you click a section from the navigation you can't return on top of this section.

See the Pen qBpeNeG by superbenj (@superbenj) on CodePen

Link to comment
Share on other sites

Hey there!

 

You were looking for the ID which wasn't returning anything, so smoother.scrollTo wasn't doing anything.

The browsers normal anchor link scrolling behaviour was happening.

See the Pen PoEMbdV?editors=1011 by GreenSock (@GreenSock) on CodePen



You'll need to grab the href attribute and also prevent default!

  • Like 3
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.
×