Material Design Dropdown Menu Plugin For jQuery menu js - Download Material Design Dropdown Menu Plugin For jQuery - menu.js

Download Material Design Dropdown Menu Plugin For jQuery – menu.js

Posted on

This time I will share jQuery Plugin and tutorial about Material Design Dropdown Menu Plugin For jQuery – menu.js, hope it will help you in programming stack.

Material Design Dropdown Menu Plugin For jQuery menu js - Download Material Design Dropdown Menu Plugin For jQuery - menu.js
File Size: 12.1 KB
Views Total: 8231
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

menu.js is a very small jQuery plugin for creating a Material Design inspired dropdown / toggle menu that allows your users to select one of a number of options.

How to use it:

1. Load jQuery library together with the menu.min.css and menu.min.js in the html page.

1 <link rel="stylesheet" href="/path/to/menu.min.css">
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/menu.min.js"></script>

2. Create a menu toggle link like this:

1 <a href="javascript:;" class="toggle" id="menu-toggle1">
2   <i class="material-icons">more_vert</i>
3 </a>

3. Create an HTML unordered list element that holds the options. Include a data-menu-toggle attribute whose value matches the id attribute of the trigger element.

01 <ul
02   class="menu"
03   data-menu
04   data-menu-toggle="#menu-toggle1, #menu-toggle2"
05 >
06   <li>
07     <a href="#">Duis aute irure dolor</a>
08   </li>
09   <li class="menu-separator"></li>
10   <li>
11     <a href="#">Lorem ipsum dolor sit amet</a>
12   </li>
13   <li>
14     <a href="#">Consectetur adipisicing elit</a>
15   </li>
16   <li>
17     <a href="#">Tempor incididunt ut</a>
18   </li>
19   <li class="menu-separator"></li>
20   <li>
21     <a href="#">Excepteur sint</a>
22   </li>
23 </ul>

4. Initialize the plugin and done.

1 $('[data-menu]').menu();

5. Customize the dropdown menu in the SCSS:

01 $menu-<a href="https://www.jqueryscript.net/tags.php?/grid/">grid</a>:       8px;
02 $menu-z-index:    96;
03  
04 $menu-bg:         #fafafa;
05 $menu-color:      #757575;
06 $menu-separator:  #eee;
07 $menu-item-hover: #eee;
08  
09 $menu-link:       $menu-color;
10 $menu-link-hover: #444;

Change log:

2017-03-04

  • Added new settings variables

2016-11-24

  • Fixed prevention of default behavior on toggle element

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

source : jqueryscript.net