Responsive Dropdown Menu jQuery mainMenu - Download Basic Responsive Dropdown Menu Plugin - jQuery mainMenu.js

Download Basic Responsive Dropdown Menu Plugin – jQuery mainMenu.js

Posted on

This time I will share jQuery Plugin and tutorial about Basic Responsive Dropdown Menu Plugin – jQuery mainMenu.js, hope it will help you in programming stack.

Responsive Dropdown Menu jQuery mainMenu - Download Basic Responsive Dropdown Menu Plugin - jQuery mainMenu.js
File Size: 10.7 KB
Views Total: 2737
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

mainMenu.js is a lightweight, fully responsive, multi-level jQuery dropdown navigation plugin that automatically collapses into a hamburger toggle menu on small screen devices.

How to use it:

1. Code the dropdown navigation as this:

01 <nav class="menu">
02   <div class="menu-header"><span class="fa">&#xf0c9;</span>Menu</div>
03   <ul class="main-menu">
04     <li><a href="#">Home</a></li>
05     <li><a href="#">About</a></li>
06     <li class="subMenu" data-trigger = "submenu"><a href="#">Category 1</a>
07       <ul>
08         <li data-trigger="submenu"><a href="#">Category 1.1</a></li>
09         <li data-trigger="submenu"><a href="#">Category 1.2</a></li>
10       </ul>
11     </li>
12     <li><a href="#">Contact</a></li>
13     <li class="subMenu" data-trigger = "submenu"><a href="">Category 2</a>
14       <ul>
15         <li data-trigger = "submenu"><a href="#">Category 2.1</a></li>
16         <li data-trigger = "submenu"><a href="#">Category 2.2</a></li>
17       </ul>
18     </li>
19   </ul>
20 </nav>

2. Include jQuery library together with the ‘jquery.mainMenu.css’ and ‘jquery.mainMenu.js’ on the webpage.

1 <link rel="stylesheet" href="css/jquery.mainMenu.css">
2 <script src="//code.jquery.com/jquery.min.js"></script>
3 <script src="js/jquery.mainMenu.js"></script>

3. Initialize the plugin to generate a default responsive dropdown navigation.

1 $(".menu").mainMenu();

4. Customize the dropdown navigation with the following options.

1 $(".menu").mainMenu({
2   "backgroundColor": "#4b5f9b",
3   "highlightColor""aqua",
4   "submenuColor":    "#5c688a",
5   "toggleSpeed":     "1000",
6   "fontColor":       "white",
7   "menuNumber":       "5"
8 });

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

source : jqueryscript.net