forked from codrops/MultiLevelMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-nestedmenus.html
236 lines (226 loc) · 9.85 KB
/
index-nestedmenus.html
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blueprint: Multi-Level Menu</title>
<meta name="description" content="Blueprint: A basic template for a responsive multi-level menu" />
<meta name="keywords" content="blueprint, template, html, css, menu, responsive, mobile-friendly" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="favicon.ico">
<!-- food icons -->
<link rel="stylesheet" type="text/css" href="css/organicfoodicons.css" />
<!-- demo styles -->
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<!-- menu styles -->
<link rel="stylesheet" type="text/css" href="css/component.css" />
<script src="js/modernizr-custom.js"></script>
</head>
<body>
<!-- Main container -->
<div class="container">
<!-- Blueprint header -->
<header class="bp-header cf">
<div class="dummy-logo">
<div class="dummy-icon foodicon foodicon--coconut"></div>
<h2 class="dummy-heading">Fooganic</h2>
</div>
<div class="bp-header__main">
<span class="bp-header__present">Blueprint <span class="bp-tooltip bp-icon bp-icon--about" data-content="The Blueprints are a collection of basic and minimal website concepts, components, plugins and layouts with minimal style for easy adaption and usage, or simply for inspiration."></span></span>
<h1 class="bp-header__title">Multi-Level Menu</h1>
<nav class="bp-nav">
<a class="bp-nav__item bp-icon bp-icon--prev" href="http://tympanus.net/Blueprints/PageStackNavigation/" data-info="previous Blueprint"><span>Previous Blueprint</span></a>
<!--a class="bp-nav__item bp-icon bp-icon--next" href="" data-info="next Blueprint"><span>Next Blueprint</span></a-->
<a class="bp-nav__item bp-icon bp-icon--drop" href="http://tympanus.net/codrops/?p=25521" data-info="back to the Codrops article"><span>back to the Codrops article</span></a>
<a class="bp-nav__item bp-icon bp-icon--archive" href="http://tympanus.net/codrops/category/blueprints/" data-info="Blueprints archive"><span>Go to the archive</span></a>
</nav>
</div>
</header>
<button class="action action--open" aria-label="Open Menu"><span class="icon icon--menu"></span></button>
<nav class="menu" id="ml-menu">
<button aria-label="Close Menu" class="action action--close"><span class="icon icon--cross"></span></button>
<div class="menu__wrap">
<ul class="menu__level" data-menu="main">
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-1" href="#">Vegetables</a>
<!-- Submenu 1 -->
<ul data-menu="submenu-1" class="menu__level">
<li class="menu__item"><a class="menu__link" href="#">Stalk Vegetables</a></li>
<li class="menu__item"><a class="menu__link" href="#">Roots & Seeds</a></li>
<li class="menu__item"><a class="menu__link" href="#">Cabbages</a></li>
<li class="menu__item"><a class="menu__link" href="#">Salad Greens</a></li>
<li class="menu__item"><a class="menu__link" href="#">Mushrooms</a></li>
<li class="menu__item"><a class="menu__link" data-submenu="submenu-1-1" href="#">Sale %</a>
<!-- Submenu 1-1 -->
<ul class="menu__level" data-menu="submenu-1-1">
<li class="menu__item">
<a class="menu__link" href="#">Fair Trade Roots</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Dried Veggies</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Our Brand</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Homemade</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-2" href="#">Fruits</a>
<!-- Submenu 2 -->
<ul class="menu__level" data-menu="submenu-2">
<li class="menu__item">
<a class="menu__link" href="#">Citrus Fruits</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Berries</a>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-2-1" href="#">Special Selection</a>
<!-- Submenu 2-1 -->
<ul class="menu__level" data-menu="submenu-2-1">
<li class="menu__item">
<a class="menu__link" href="#">Exotic Mixes</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Wild Pick</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Vitamin Boosters</a>
</li>
</ul>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Tropical Fruits</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Melons</a>
</li>
</ul>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-3" href="#">Grains</a>
<!-- Submenu 3 -->
<ul class="menu__level" data-menu="submenu-3">
<li class="menu__item">
<a class="menu__link" href="#">Buckwheat</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Millet</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Quinoa</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Wild Rice</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Durum Wheat</a>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-3-1" href="#">Promo Packs</a>
<!-- Submenu 3-1 -->
<ul class="menu__level" data-menu="submenu-3-1">
<li class="menu__item">
<a class="menu__link" href="#">Starter Kit</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">The Essential 8</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Bolivian Secrets</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Flour Packs</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-4" href="#">Mylk & Drinks</a>
<!-- Submenu 4 -->
<ul class="menu__level" data-menu="submenu-4">
<li class="menu__item">
<a class="menu__link" href="#">Grain Mylks</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Seed Mylks</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Nut Mylks</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Nutri Drinks</a>
</li>
<li class="menu__item">
<a class="menu__link" data-submenu="submenu-4-1" href="#">Selection</a>
<!-- Submenu 4-1 -->
<ul class="menu__level" data-menu="submenu-4-1">
<li class="menu__item">
<a class="menu__link" href="#">Nut Mylk Packs</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Amino Acid Heaven</a>
</li>
<li class="menu__item">
<a class="menu__link" href="#">Allergy Free</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="content">
<p class="info">Please choose a category</p>
<!-- Ajax loaded content here -->
</div>
</div>
<!-- /view -->
<script src="js/classie.js"></script>
<script src="js/dummydata.js"></script>
<script src="js/main.js"></script>
<script>
(function() {
var menuEl = document.getElementById('ml-menu'),
mlmenu = new MLMenu(menuEl, {
// breadcrumbsCtrl : true, // show breadcrumbs
// initialBreadcrumb : 'all', // initial breadcrumb text
backCtrl : false, // show back button
itemsDelayInterval : 0, // delay between each menu item sliding animation
onItemClick: loadDummyData // callback: item that doesn´t have a submenu gets clicked - onItemClick([event], [inner HTML of the clicked item])
});
// mobile menu toggle
var openMenuCtrl = document.querySelector('.action--open'),
closeMenuCtrl = document.querySelector('.action--close');
openMenuCtrl.addEventListener('click', openMenu);
closeMenuCtrl.addEventListener('click', closeMenu);
function openMenu() {
classie.add(menuEl, 'menu--open');
}
function closeMenu() {
classie.remove(menuEl, 'menu--open');
}
// simulate grid content loading
var gridWrapper = document.querySelector('.content');
function loadDummyData(ev, itemName) {
ev.preventDefault();
closeMenu();
gridWrapper.innerHTML = '';
classie.add(gridWrapper, 'content--loading');
setTimeout(function() {
classie.remove(gridWrapper, 'content--loading');
gridWrapper.innerHTML = '<ul class="products">' + dummyData[itemName] + '<ul>';
}, 700);
}
})();
</script>
</body>
</html>