-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
37 lines (31 loc) · 1.06 KB
/
script.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
window.onload = function() {
window.scrollTo(0, 0);
};
function showNewsletterPopup() {
const overlay = document.getElementById('overlay');
overlay.style.display = 'flex';
}
document.addEventListener('DOMContentLoaded', function () {
const overlay = document.getElementById('overlay');
const popup = document.getElementById('popup');
overlay.addEventListener('click', function (event) {
if (event.target === overlay) {
overlay.style.display = 'none';
}
});
popup.addEventListener('submit', function (event) {
event.preventDefault();
const email = document.getElementById('email').value;
overlay.style.display = 'none';
});
});
// to display nav with width less than 700px
function showMenu() {
console.log("Menu button clicked");
const navLinksContainer = document.getElementById('nav-links-container');
if (navLinksContainer.classList.contains('active')) {
navLinksContainer.classList.remove('active');
} else {
navLinksContainer.classList.add('active');
}
}