-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript2.js
More file actions
32 lines (26 loc) · 1010 Bytes
/
script2.js
File metadata and controls
32 lines (26 loc) · 1010 Bytes
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
/*=============== SHOW MENU ===============*/
const showMenu = (toggleId, navId) =>{
const toggle = document.getElementById(toggleId),
nav = document.getElementById(navId)
toggle.addEventListener('click', () =>{
// Add show-menu class to nav menu
nav.classList.toggle('show-menu')
// Add show-icon to show and hide menu icon
toggle.classList.toggle('show-icon')
})
}
showMenu('nav-toggle','nav-menu')
/*=============== SHOW SCROLL UP ===============*/
const scrollUp = () =>{
const scrollUp = document.getElementById('scroll-up')
// When the scroll is higher than 350 viewport height, add the show-scroll class to the a tag with the scrollup class
this.scrollY >= 350 ? scrollUp.classList.add('show-scroll'): scrollUp.classList.remove('show-scroll')
}
window.addEventListener('scroll', scrollUp)
// ========= view all btn =========
function ok(){
window.location = "../category/main.php";
}
function signup(){
window.location= "../signup/signup.html";
}