1. Please scroll 😁

    doormat

  2. How about something a little different for navigating through your site content?

  3. How does this work? It's actually quite simple.

    The trick is possible by making sections of the page position: fixed and then setting a height for the document body equal to the combined height of the page sections. When the window is scrolled down we move our page sections upwards out of the viewport to reveal the content underneath. The opposite being that, when the window is scrolled up, we bring our sections back down into view in the same order in which they left( dictated by the DOM structure ).

  4. Using doormat

    1. Include doormat.js and doormat.css in your page.
    2. Create your DOM structure. The structure needs to be a container with the classname dm . Child elements need to have the classname dm__pnl . ol and ul are appropriate elements.

      <ol class="dm">
        <li class="dm__pnl">Awesome</li>
        <li class="dm__pnl">Site</li>
        <li class="dm__pnl">Content</li>
      </ol>
    3. Invoke the Doormat function passing in desired options( refer to docs ). For example;

      var myDoormat = new Doormat();
      var myDoormat = new Doormat({
        scrollBuffer : 15,
        snapThreshold: 15,
        snapDuration : 250
      });
  5. That's it!

    For more, see the repo !