Smart Sticky Header Hamburger Navigation Plugin - jQuery mhead

Smart Sticky Header Hamburger Navigation Plugin - jQuery mhead
File Size: 54.2 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

mhead is a jQuery plugin used to create a sticky header hamburger navigation for your web application that auto shows/hides as you scroll/swipe the page down or up.

How to use it:

1. The plugin depends on jQuery library and jQuery mmenu plugin.

<script src="/path/to/jquery.js"></script>
<link rel="stylesheet" href="/path/to/jquery.mmenu.all.css">
<script src="/path/to/jquery.mmenu.all.js"></script>

2. Load the mhead plugin's JS and CSS files in the document.

<link rel="stylesheet" href="jquery.mhead.css">
<script src="jquery.mhead.js"></script>

3. Load the latest Font Awesome for the navigation icons.

<link rel="stylesheet" href="/path/to/font-awesome.min.css">

4. Create the header navigation bar.

<div class="mh-head Sticky">
  <span class="mh-btns-left">
    <a class="fa fa-bars" href="#menu"></a>
  </span>
  <span class="mh-text">demo</span>
</div>

5. Inert your own menu items to the navigation.

<nav id="menu">
  <ul>
    <li><a href="#">Home</a></li>
    <li><span>About us</span>
      <ul>
        <li><a href="#">History</a></li>
        <li><span>The team</span>
          <ul>
            <li><a href="#">Management</a></li>
            <li><a href="#">Sales</a></li>
            <li><a href="#">Development</a></li>
          </ul>
        </li>
        <li><a href="#">Our address</a></li>
      </ul>
    </li>
    <li><a href="#">Contact</a></li>
  </ul>
</nav>

6. Initialize the plugin with default settings and we're done.

//  create a menu
$('#menu').mmenu();

//  fire the plugin
$('.mh-head').mhead();

7. All default settings to customize the header navigation.

$('.mh-head').mhead({
  scroll: {
    hide: 0,
    show: 0,
    tolerance: 4
  },
  hamburger: {
    menu: null,
    animation: "collapse"
  }
});

Change log:

2017-08-21

  • v1.0.1

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