Search code examples
javascriptscrollpositionfixed

Javascript - onscroll moves smoothly to next anchor? How-To?


I'm building a single-page website with a few sections that each fill out the user's window; I've got that working.

What I want to do is:

When the user scrolls up or down he/she would ease-up or down (accordingly) to the section before or after. My sections each have a anchor at the top of them.

Here is an example of what I'm trying to achieve. Each article fills the page. Once you scroll you jump to the next article.

http://www.made-my-day.com/


Solution

  • I think you could get the job done using this plugin: https://github.com/alvarotrigo/fullPage.js.

    Also, it seems to be actively updated. The last commit to the repo was made 3 days ago.

    Cheers!