-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (28 loc) · 906 Bytes
/
app.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
// const navSlide = () => {
// const burger = document.querySelector('.ham');
// const nav=document.querySelector('.nav-links');
// burger.addEventListener('click', () => {
// nav.classList.toggle('nav-active');
// })
// }
// navSlide();
const navbarTop = document.querySelector('.header');
var element = document.getElementById("nav-links");
var tog=document.querySelector('.fas');
function myFunction() {
element.classList.toggle("nav-actives");
}
tog.addEventListener('click', ()=>{
tog.classList.toggle('fa-times');
})
window.addEventListener('scroll', function () {
if (window.scrollY >= 150) {
navbarTop.classList.add('onScroll');
} else {
navbarTop.classList.remove('onScroll');
}
});
element.addEventListener('click', ()=>{
element.classList.remove("nav-actives");
tog.classList.remove('fa-times');
});