This time I will share jQuery Plugin and tutorial about Smart SEO-friendly Mobile Menu Plugin – jQuery smobileMenu, hope it will help you in programming stack.
A smart, SEO-friendly navigation jQuery plugin that automatically transforms a nested HTML list into a fullscreen, mobile-friendly, multi-level navigation menu.
How to use it:
1. To get started, include jQuery and other required resources on the web page.
2 |
< link rel = "stylesheet" href = "dist/css/smart-mobile-menu.css" > |
4 |
< link rel = "stylesheet" href = "dist/css/smm-theme-default.css" > |
6 |
< script src = "/path/to/jquery.min.js" ></ script > |
8 |
< script src = "dist/js/smart-mobile-menu.js" ></ script > |
2. Add the following data
attributes to the regular list based navigation menu:
- data-smart-menu: trigger element to toggle the mobile menu
- data-smart-menu-active-auto: auto open submenus
- data-smart-menu-dropdown: enable/disable submenus
- data-smart-menu-theme: theme name
- data-smm-hidden: hide the menu in the mobile menu
- data-smm-dropdown: enable/disable submenus in the mobile menu
02 |
data-smart-menu = "#open_mobile_menu" |
03 |
data-smart-menu-active-auto = "true" |
04 |
data-smart-menu-dropdown = "true" |
05 |
data-smart-menu-theme = "default" > |
06 |
< li >< a href = "#" >Home</ a ></ li > |
09 |
< a href = "#" >Category</ a > |
11 |
< li >< a href = "#" >HTML5</ a ></ li > |
12 |
< li >< a class = "smm-active" href = "#" >CSS/CSS3</ a ></ li > |
14 |
< a href = "#" >JavaScript</ a > |
16 |
< li >< a href = "#" >jQuery</ a ></ li > |
17 |
< li >< a href = "#" >VueJS</ a ></ li > |
18 |
< li >< a href = "#" >ReactJS</ a ></ li > |
25 |
< ul data-smm-dropdown = "false" > |
26 |
< li >< a href = "#" >About</ a ></ li > |
27 |
< li >< a href = "#" >Contact</ a ></ li > |
28 |
< li >< a href = "#" >Blog</ a ></ li > |
3. Create a trigger element to toggle the mobile menu.
4. You can also initialize the mobile menu in the JavaScript:
1 |
$( '#open_mobile_menu' ).smobileMenu({ |
5 |
dropdownIcon: '<i class="fa fa-angle-down"></i>' , |
6 |
linkActiveClass: 'smm-active' , |
5. Create your own themes as you see in the smm-theme-default.css
.
01 |
ul.smobilemenu-theme- default { |
03 |
padding : 20px !important ; |
08 |
ul.smobilemenu-theme- default li { |
09 |
border-bottom : #333 1px solid ; |
13 |
ul.smobilemenu-theme- default li a { |
16 |
text-decoration : none ; |
17 |
font-family : 'Roboto' , sans-serif ; |
20 |
ul.smobilemenu-theme- default li a.smm-active { |
24 |
ul.smobilemenu-theme- default li a > i { |
29 |
#smobileMenu-close-btn { |
30 |
position : absolute ;<
source : jquery.net
|