You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
669 B
JavaScript
17 lines
669 B
JavaScript
2 years ago
|
var modal = document.querySelector('.modal'); // assuming you have only 1
|
||
|
var html = document.querySelector('html');
|
||
|
modal.querySelector('.modal-background').addEventListener('click', function(e) {
|
||
|
e.preventDefault();
|
||
|
modal.classList.remove('is-active');
|
||
|
html.classList.remove('is-clipped');
|
||
|
});
|
||
|
modal.querySelector('.modal-close').addEventListener('click', function(e) {
|
||
|
e.preventDefault();
|
||
|
modal.classList.remove('is-active');
|
||
|
html.classList.remove('is-clipped');
|
||
|
});
|
||
|
modal.querySelector('.modal-close-button').addEventListener('click', function(e) {
|
||
|
e.preventDefault();
|
||
|
modal.classList.remove('is-active');
|
||
|
html.classList.remove('is-clipped');
|
||
|
});
|