-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnav.html
59 lines (57 loc) · 2.4 KB
/
nav.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
<script>
$(".navbar-nav").children().each(function () {
if ($(this).hasClass("dropdown")) {
if (window.location.pathname.indexOf("Member") >= 0) {
$(this).addClass("active");
}
} else {
if (window.location.pathname.indexOf($(this).children().attr("href")) >= 0) {
$(this).addClass("active");
} else if ($(this).children().attr("href") == "index.html" && window.location.pathname == "/") {
$(this).addClass("active");
}
}
});
console.log(window.location.pathname)
$(".navbar-toggler").addClass("collapsed");
$(".navbar-toggler").click(function () {
if ($(window).scrollTop() > 50 || $(".navbar-toggler").hasClass("collapsed"))
navAddBackground();
else
navRemoveBackground();
});
</script>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggler">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="index.html"><img src="/img/logo_LeRoiRobotics2X.png" width="164" height="55"
class="d-inline-block align-top" alt="" /></a>
<div class="collapse navbar-collapse" id="navbarToggler">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="vex.html">VEX</a>
</li>
<li class="nav-item dropdown" id="membersDropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button"
data-toggle="dropdown">
Members
</a>
<div class="dropdown-menu p-4 text-muted">
<a class="dropdown-item" href="Member-Leo.html">Leo</a>
<a class="dropdown-item" href="Member-Kevin.html">Kevin</a>
<a class="dropdown-item" href="Member-Simon.html">Simon</a>
<a class="dropdown-item" href="Member-Andrew.html">Andrew</a>
<a class="dropdown-item" href="Member-Ivory.html">Ivory</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="gallery.html">Gallery</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact.html">Contact</a>
</li>
</ul>
</div>