forked from prabhxjottsingh/codechef-cu-chapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinal.js
More file actions
21 lines (18 loc) · 665 Bytes
/
final.js
File metadata and controls
21 lines (18 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const navBtn = document.getElementById('nav-btn');
const cancelBtn = document.getElementById('cancel-btn');
const sideNav = document.getElementById('side-nav');
const modal = document.getElementById('modal');
navBtn.addEventListener("click", function(){
sideNav.classList.add('show');
modal.classList.add('showModal');
});
cancelBtn.addEventListener('click', function(){
sideNav.classList.remove('show');
modal.classList.remove('showModal');
});
window.addEventListener('click', function(event){
if(event.target === modal){
sideNav.classList.remove('show');
modal.classList.remove('showModal');
}
});