Creating A Responsive Mobile Navigation Menu with slicknav jQuery Plugin

File Size: 23.7 KB
Views Total: 59305
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Creating A Responsive Mobile Navigation Menu with slicknav jQuery Plugin

slicknav is a simple and easy-to-use jQuery menu plugin for creating a responsive & cross-browser multi-level navigation menu on your website. The plugin makes use of CSS media queries to hide the original menu and display the mobile menu when appropriate.

More Features:

  • Responsive, smart and flexible.
  • Customizable menu sliding animation.
  • Optional easing animation supported.
  • Keyboard Accessible.

How to use it:

1. Include required jQuery slicknav stylesheet file in the head section of your page.

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

2. Create an unordered list for the mobile menu.

<ul id="menu">
<li><a href="">Blog</a></li>
<li>jQuery Plugins
<li><a href="">Latest</a></li>
<li><a href="">Most Popular</a></li>
<li><a href="">Recommended</a></li>
<li><a href="#">Publishing</a></li>
<li><a href="#">Top Menu 2</a></li>
<li>Top Menu 3</li>
<li>Top Menu 4
<li><a href="#">item 1</a></li>
<li><a href="#">item 2</a></li>
<li><a href="#">item 3</a></li>

3. Using CSS media queries to hide original menu on mobile devices.

.slicknav_menu {
display: none;
 @media screen and (max-width: 40em) {
.js #menu {
display: none;
.js .slicknav_menu {
display: block;

4. Load the latest jQuery javascript library and jQuery slicknav plugin at the bottom.

<script src=""></script>
<script src="jquery.slicknav.js"></script> 

5. Include jQuery UI or jQuery easing plugin for easing options. (OPTIONAL)

<script src="jquery.easing.1.3.js"></script>

6. Call the plugin with options.



// Label for menu button. 
// Use an empty string for no label.
'label' : 'MENU', 

// If true, the mobile menu is a copy of the original.
'duplicate': true, 

// The duration of the sliding animation.
'duration': true, 

// Easing used for open animations.
'easingOpen': 'swing', 

// Easing used for close animations.
'easingClose': 'swing', 

// open / close symbols
closedSymbol: '&#9658;',
openedSymbol: '&#9660;',

// Element, jQuery object, or jQuery selector string to prepend the mobile menu to.
'prependTo': 'body', 

// Element, jQuery object, or jQuery selector string to append the mobile menu to.
appendTo: '',

// Element type for parent menu items.
'parentTag': 'a', 

// Close menu when a link is clicked.
'closeOnClick': false,

// Allow clickable links as parent elements.
allowParentLinks: false,

// If false, parent links will be separated from the sub-menu toggle.
nestedParentLinks: true,

// Show children of parent links by default.
showChildren: false,

// Remove IDs from all menu elements.
removeIds: true,

// Remove classes from all menu elements.
removeClasses: false,

// Remove styles from all menu elements.
removeStyles: false,

// Add branding to menu bar.
brand: '',

// Animation library. Currently supports "jquery" and "velocity".
animations: 'jquery',

// Called after SlickNav creation
init: function () {},

// Called before menu or sub-menu opened
beforeOpen: function () {},

// Called before menu or sub-menu closed
beforeClose: function () {},

// Called after menu or sub-menu opened.
afterOpen: function () {},

// Called after menu or sub-menu closed.
afterClose: function () {}



7. Public methods.

// toggle the menu

// open the menu

// close the menu

8. Write some CSS to make the original menu presentable.

ul#menu {...}

Change logs:

v1.0.10 (2016-10-05)

  • Version bump and Velocity.js fix
  • Ensure Keyboard variable declared

v1.0.8 (2016-09-20)

  • Add support for Velocity.js animations and stop animation queue before animating.
  • Significantly better ARIA keyboard support

v1.0.7 (2016-03-24)

  • bugfix

v1.0.5 (2015-11-30)

  • Menu button sizing for Firefox Mobile v42. 

v1.0.4 (2015-06-07)

  • Variable assignment fix
  • Fix symbols if showChildren true


  • v1.0.3



  • Update.


  • Fix toggle method.


  • Fix close on click multilevel bug


  • menu toggle fixes


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