-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
47 lines (38 loc) · 1.43 KB
/
main.js
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
// // sticky nav menu
// $(document).ready(function (){
// let nav_offset_top = $('.header_area').height() + 50;
// function navbarFixed() {
// if ($('.header_area').length) {
// $(window).scroll(function() {
// let scroll = $(window).scrollTop();
// if (scroll >= nav_offset_top) {
// $('.header_area .main-menu').addClass('navbar_fixed');
// } else {
// $('.header_area .main-menu').removeClass('navbar_fixed');
// }
// })
// }
// }
// navbarFixed();
// });
// var items = document.getElementsByClassName("nav-item");
// var links = header.getElementsByClassName("nav-link");
// var navCont = document.getElementById("navbarNav");
// var links = navCont.getElementsByClassName("nav-item");
// for (let i = 0; i < links.length; i++) {
// links[i].addEventListener("click", function () {
// var currentActive = document.getElementsByClassName("active");
// currentActive[0].classList.remove("active");
// this.classList.add("active");
// });
// }
// $(document).ready(function() {
// $('navbar-nav li a').click(function() {
// $(this).siblings('li').removeClass('active');
// $(this).parent().addClass('active');
// });
// });
$(document).on("click", "ul li", function () {
$("li").removeClass("active");
$(this).addClass("active");
});