-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
29 lines (22 loc) · 710 Bytes
/
code.js
File metadata and controls
29 lines (22 loc) · 710 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
function toggleNav() {
const navLinks = document.querySelector('.nav-menu');
navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
}
const modal = document.getElementById("contact-modal");
const btn = document.getElementById("contact-btn");
const closeSpan = document.getElementsByClassName("close")[0];
btn.onclick = function() {
modal.style.display = "block";
}
closeSpan.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
document.getElementById('contact-form').onsubmit = function() {
modal.style.display = "none";
return true;
}