Pure JavaScript Sticky Header On Scroll – header-on-scroll.js

Category: Javascript , Menu & Navigation | June 15, 2016
Author: amandamussio
Views Total: 4,626
Official Page: Go to website
Last Update: June 15, 2016
License: MIT

Preview:

Pure JavaScript Sticky Header On Scroll – header-on-scroll.js

Description:

header-on-scroll.js is a native JavaScript library used to create a responsive sticky header navigation which reveals on scroll down and hides on scroll up.

How to use it:

Load the required style sheet style.css in the head section to style the header navigation.

<link rel="stylesheet" href="style.css">

The primary HTML for the header navigation.

<header id="header-main">
  <div class="container">
    <div id="menu-icon">
      <span class="icon-menu-hamburguer"></span>
    </div>
    <nav id="menu-main">
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">Contact</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Portfolio</a></li>
        <li><a href="#">Blog</a></li>
      </ul>
    </nav>
  </div>
</header>

Place the core JavaScript file header-on-scroll-min.js at the end of the document. That’s it.

<script src="header-on-scroll-min.js"></script>

You Might Be Interested In:


Leave a Reply