-
Notifications
You must be signed in to change notification settings - Fork 619
/
index.html
70 lines (59 loc) · 1.86 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Responsive Nav · Public Events Demo</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="../../responsive-nav.css">
<script src="../../responsive-nav.js"></script>
</head>
<body>
<nav class="nav-collapse">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Projects</a></li>
<li><a href="#">Blog</a></li>
</ul>
</nav>
<button id="toggle">Toggle menu</button>
<button id="open">Open menu</button>
<button id="close">Close menu</button>
<button id="destroy">Destroy menu</button>
<button id="resize">Call resize method manually</button>
<script>
// Init Responsive Nav
var nav = responsiveNav(".nav-collapse");
// Toggle Nav
var toggle = document.getElementById("toggle");
toggle.addEventListener("click", function (e) {
e.preventDefault();
nav.toggle();
}, false);
// Open Nav
var open = document.getElementById("open");
open.addEventListener("click", function (e) {
e.preventDefault();
nav.open();
}, false);
// Close Nav
var close = document.getElementById("close");
close.addEventListener("click", function (e) {
e.preventDefault();
nav.close();
}, false);
// Destroy Nav
var destroy = document.getElementById("destroy");
destroy.addEventListener("click", function (e) {
e.preventDefault();
nav.destroy();
}, false);
// Call Resize method manually
var resize = document.getElementById("resize");
resize.addEventListener("click", function (e) {
e.preventDefault();
nav.resize();
}, false);
</script>
</body>
</html>