-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.js
More file actions
24 lines (20 loc) · 717 Bytes
/
Copy pathbase.js
File metadata and controls
24 lines (20 loc) · 717 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
'use strict';
var mobile_nav_button = document.getElementById('mobile-nav-button');
var mobile_nav = document.getElementById('mobile-nav');
var mobile_nav_exit = document.getElementById('mobile-nav-exit');
function activateMobileNav() {
mobile_nav.style.display = 'block';
setTimeout(() => {
mobile_nav.className = 'mobile-nav-menu active';
}, 10);
document.body.style.overflow = 'hidden';
}
function closeMobileNav() {
mobile_nav.className = 'mobile-nav-menu';
setTimeout(() => {
mobile_nav.style.display = 'none';
}, 200);
document.body.style.overflow = 'auto';
}
mobile_nav_button.addEventListener('click', activateMobileNav);
mobile_nav_exit.addEventListener('click', closeMobileNav);