Sticky Header Navigation jQuery - Download Simple Sticky Header Navigation With jQuery

Download Simple Sticky Header Navigation With jQuery

Posted on

This time I will share jQuery Plugin and tutorial about Simple Sticky Header Navigation With jQuery, hope it will help you in programming stack.

Sticky Header Navigation jQuery - Download Simple Sticky Header Navigation With jQuery

File Size: 19.1 KB
Views Total: 5535
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A really simple jQuery plugin to create a sticky header navigation that automatically adds a CSS class (sticky-header) to the nav menu as you scroll past it.

How to use it:

1. Create a normal navigation menu for your webpage.

1 <nav class="navbar">
2   <ul>
3     <li><a href="#">Link 1</a></li>
4     <li><a href="#">Link 2</a></li>
5     <li><a href="#">Link 3</a></li>
6     <li><a href="#">Link 4</a></li>
7   </ul>
8 </nav>

2. Place jQuery library and the Simple Sticky Header plugin’s script at the end of the document.

1 <script src="//code.jquery.com/jquery-1.12.4.min.js"></script>
2 <script src="simple-sticky-header.js"></script>

3. Call the function on the navigation menu.

1 $(function() {
2   $("#sticky-header").simpleStickyHeader();
3 });

4. Stick the navigation menu to the top of the screen as you scroll down the webpage.

1 .sticky-header {
2   position: fixed;
3   top: 0;
4   left: 0;
5 }

This awesome jQuery plugin is developed by oenstrom. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net