"menu"
Bootstrap 3.3.0 Snippet by ravindra93

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="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="nav-wrapper">
<a href="#" class="js-nav-toggle">
<span></span>
</a>
<nav role="navigation">
<div class="nav-toggle">
<span class="nav-back"></span>
<span class="nav-title">Menu</span>
<span class="nav-close"></span>
</div>
<ul>
<li class="has-dropdown">
<a href="#">Category</a>
<ul>
<li><a href="#">Cat 1</a></li>
<li><a href="#">Cat 2</a></li>
<li><a href="#">Cat 3</a></li>
<li><a href="#">Cat 4</a></li>
<li><a href="#">Cat 5</a></li>
<li><a href="#">Cat 6</a></li>
<li><a href="#">Cat 7</a></li>
</ul>
</li>
<li class="has-dropdown">
<a href="#">Apparel</a>
<ul>
<li class="has-dropdown">
<a href="#">Loremus</a>
<ul>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</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
.debugger {
position: absolute;
left: 50%;
top: 0;
}
* {
margin: 0;
box-sizing: border-box;
font-family: "Open Sans", Arial, sans-serif;
}
.nav-wrapper {
position: relative;
width: 300px;
height: 100vh;
transition: transform 0.3s;
transform: translateX(-100%);
}
.nav-wrapper.show-menu {
transform: none;
}
.js-nav-toggle {
position: absolute;
top: 0;
right: -60px;
width: 43px;
height: 40px;
margin: 15px 0 0 15px;
display: block;
float: left;
padding: 0;
color: #345;
border: 2px solid #345;
z-index: 2;
}
.js-nav-toggle span {
position: relative;
background-color: #345;
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
(function($) {
this.MobileNav = function() {
this.curItem,
this.curLevel = 0,
this.transitionEnd = _getTransitionEndEventName();
var defaults = {
initElem: ".main-menu",
menuTitle: "Menu"
}
// Check if MobileNav was initialized with some options and assign them to the "defaults"
if (arguments[0] && typeof arguments[0] === "object") {
this.options = extendDefaults(defaults, arguments[0]);
}
// Add to the "defaults" ONLY if the key is already in the "defaults"
function extendDefaults(source, extender) {
for (option in extender) {
if (source.hasOwnProperty(option)) {
source[option] = extender[option];
}
}
}
MobileNav.prototype.getCurrentItem = function() {
return this.curItem;
};
MobileNav.prototype.setMenuTitle = function(title) {
defaults.menuTitle = title;
_updateMenuTitle(this);
return title;
};
// Init is an anonymous IIFE
(function(MobileNav) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: