"Mobile-friendly Multi-level Dropdown Menu Plugin - jQuery Stellarnav"
Bootstrap 3.0.0 Snippet by foysal991

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link href="https://fonts.googleapis.com/css?family=Exo+2:300,400" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="all" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div id="main-nav" class="stellarnav">
<ul>
<li><a href="">Dropdown</a>
<ul>
<li><a href="#">How deep?</a>
<ul>
<li><a href="#">Deep</a>
<ul>
<li><a href="#">Even deeper</a>
<ul>
<li><li><a href="#">Item</a></li></li>
<li><li><a href="#">Item</a></li></li>
<li><li><a href="#">Item</a></li></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</li>
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Stellarnav.js 1.2.0
* jQuery responsive multi-level dropdown menu designed to do most of the heavy CSS work for you.
* Copyright (c) 2016 Vinny Moreira - http://vinnymoreira.com
* Released under the MIT license
*/
/* all nav */
.stellarnav { position: relative; width: 100%; z-index: 9900; line-height: normal; }
.stellarnav ul { margin: 0; padding: 0; text-align: center; }
.stellarnav li { list-style: none; display: block; margin: 0; padding: 0; position: relative; line-height: normal; vertical-align: middle; }
.stellarnav li a { padding: 15px; display: block; text-decoration: none; color: #777; font-size: inherit; font-family: inherit; box-sizing: border-box; -webkit-transition: all .3s ease-out; -moz-transition: all .3s ease-out; transition: all .3s ease-out; }
/* main level */
.stellarnav > ul > li { display: inline-block; }
.stellarnav > ul > li > a { padding: 20px 40px; }
/* first level dd */
.stellarnav ul ul { top: auto; width: 220px; position: absolute; z-index: 9900; text-align: left; display: none; background: #ddd; }
.stellarnav li li { display: block; }
/* second level dd */
.stellarnav ul ul ul { top: 0; /* dd animtion - change to auto to remove */ left: 220px; }
.stellarnav > ul > li:hover > ul > li:hover > ul { opacity: 1; visibility: visible; top: 0; }
/* .drop-left */
.stellarnav > ul > li.drop-left > ul { right: 0; }
.stellarnav li.drop-left ul ul { left: auto; right: 220px; }
/* light theme */
.stellarnav.light { background: rgba(255, 255, 255, 1); }
.stellarnav.light ul ul { background: rgba(255, 255, 255, 1); }
.stellarnav.light li a { color: #000; }
.stellarnav.light .menu-toggle, .stellarnav.light .call-btn-mobile, .stellarnav.light .location-btn-mobile, .stellarnav.light .close-menu { color: rgba(0, 0, 0, 1); }
/* dark theme */
.stellarnav.dark { background: rgba(0, 0, 0, 1); }
.stellarnav.dark ul ul { background: rgba(0, 0, 0, 1); }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Stellarnav.js 1.2.0
* jQuery responsive multi-level dropdown menu designed to do most of the heavy CSS work for you.
*
* Copyright (c) 2016 Vinny Moreira - http://vinnymoreira.com
*
* Released under the MIT license
*/
(function($) {
$.fn.stellarNav = function(options, width, breakpoint) {
var $nav, $width, $breakpoint;
nav = $(this);
width = $(window).width();
// default settings
var settings = $.extend( {
theme : 'plain', // adds default color to nav. (light, dark)
breakpoint: 768, // number in pixels to determine when the nav should turn mobile friendly
phoneBtn: false, // adds a click-to-call phone link to the top of menu - i.e.: "18009084500"
locationBtn: false, // adds a location link to the top of menu - i.e.: "/location/", "http://site.com/contact-us/"
sticky : false, // makes nav sticky on scroll (desktop only)
position: 'static', // 'static' or 'top' - when set to 'top', this forces the mobile nav to be placed absolutely on the very top of page
showArrows: true, // shows dropdown arrows next to the items that have sub menus
closeBtn : false, // adds a close button to the end of nav
scrollbarFix: false // fixes horizontal scrollbar issue on very long navs
}, options );
return this.each( function() {
// defines black or white themes
if (settings.theme == 'light' || settings.theme == 'dark') {
nav.addClass(settings.theme);
}
if (settings.breakpoint) {
breakpoint = settings.breakpoint;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: