sigit_design/assets/js/popups.js

20 lines
858 B
JavaScript
Raw Normal View History

2024-07-25 16:16:25 +00:00
// Function to handle loginBtn click
document.getElementById('loginBtn').addEventListener('click', function() {
var popupLogin = document.getElementById('popupLogin');
popupLogin.style.display = 'flex';
document.body.style.overflow = 'hidden'; // Disable scroll
});
// Function to handle popupMainInsideWrapperBoxTopBtn click
document.addEventListener('click', function(event) {
var clickedElement = event.target;
var popupMainInsideWrapperBoxTopBtn = document.querySelector('.popupMainInsideWrapperBoxTopBtn');
// Check if the clicked element or its parent elements match the target
if (popupMainInsideWrapperBoxTopBtn.contains(clickedElement)) {
2024-07-25 16:16:25 +00:00
var popupLogin = document.getElementById('popupLogin');
popupLogin.style.display = 'none';
document.body.style.overflow = ''; // Re-enable scroll
}
});