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

Category: Javascript , Menu & Navigation | June 15, 2016
Views Total:4,354 views
Official Page:Go to website
Last Update:June 15, 2016


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


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>
    <nav id="menu-main">
        <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>

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