-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
39 lines (29 loc) · 1.01 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
class ProductFactory{
constructor(){
}
btn = document.querySelector(".toggle-btn");
mobile_nav = document.querySelector(".nav-menu-mobile");
eachMaster = document.querySelectorAll(".masters-row-with-overlay");
run(){
//LISTEN FOR EVENTS HERE
this.btn.addEventListener("click",this.showNav);
Array.from(this.eachMaster).forEach((master) => {
master.addEventListener("mouseover",this.showLayer);
});
}
showNav = (e) => {
this.mobile_nav.classList.toggle('show');
}
showLayer = (e)=> {
console.log("Hi, you work");
console.log(e.target.parentElement.children[1]);
e.target.parentElement.children[1].classList.toggle('show');
}
}
let decadev_one = new ProductFactory();
decadev_one.run();
AOS.init({
once: true, // whether animation should happen only once - while scrolling down
mirror: false, // whether elements should animate out while scrolling past them
anchorPlacement: 'top-bottom',
});