thisissoon / angular-scrollspy

A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport
MIT License
35 stars 15 forks source link

Wrong navlink gets active class and animated scrolling #10

Closed JonasJW closed 6 years ago

JonasJW commented 6 years ago

Hi,

I have implemented angular-scrollspy and it works pretty well. However I still have one problem:

When I click a navigation link it scrolls to the correct section but it seems like it scrolls just before the start of this section so the navigation link of the previous section is highlighted/gets the active class.

Also there are no scroll animations. Is there a good way to have the actual scrolling animated?

Thanks and best regards!

edoparearyee commented 6 years ago

Hi @JonasJW currently this library does not have the functionality to scroll to an element. For scrolling functionality I would recommend using the browsers native window.scrollTo() with behavior: "smooth" option. See example here