Sticky headers introduction

Beautiful sticky headers, with ease

Create a beautiful, eye-catching navigation header for mobile websites and web-apps, completely in style and fully compatible with the mmenu.js navigation menu.

As easy as it gets

A sticky navigation header might not be all that hard to create, but with the jQuery.mhead plugin you'll be able to do them exactly right, with very little effort. Just have a look at the examples below.

Animated headers

The jQuery.mhead plugin keeps the navigation header in view for the user when appropriate, while saving space and focus for your content the rest of the time.



The jQuery.mhead plugin is licensed under the Creative Commons Attribution 4.0 International license. You can use it in all your personal, non-commercial and commercial projects.


Install with NPM:
npm install jquery.mhead


Download directly from the Github repository.

How to use

Here's a basic HTML example for a header showing a title and a hamburger icon.

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

Check out this tutorial for more detailed information on how to use the jQuery.mhead plugin.

About the HTML

You can basically add any HTML inside a <div class="mh-header" />, but a lot of commonly used content hass already been made available. Here's a complete overview of all available classnames.

The header
The header itself.
Enlarges the header two or three times.
Aligns the text (.mh-text) or logo (.mh-logo) to the left or right.
A wrapper for a single button on the left or right.
A wrapper for two or three buttons on the left or right.
This button will be transformed into a functional animated hamburger icon.
The header text.
A scrollable list of anchors.
A searchfield with submit button.
An image fitted in the available space.
An image filling up the available space.


The jQuery.mhead plugin provides a set of options for customizing your header. The default values can be overridden by passing new values to the method.

    $(document).ready(function() {
            // options

Available options

Option Datatype Default value Description
1 See the description.
scroll A map of options or false for scroll.hide (and
hide Number 0 Amount of pixels to scroll down before hiding the header.
show Number 0 Amount of pixels to scroll up before showing the header.
tolerance Number 4 Minimum amount of pixels to scroll per scroll-event before showing or hiding the header.
menu String null 1 Query selector for the menu that should be opened when clicking the hamburger icon. If omitted, the plugin will use the anchor href attribute or target the first mmenu menu that it finds.
animation String "collapse" The animation to use.