fixed a js issue with the login popup close button not working sometimes
This commit is contained in:
parent
8dda7b116a
commit
ff051837ba
@ -8,7 +8,10 @@ document.getElementById('loginBtn').addEventListener('click', function() {
|
|||||||
// Function to handle popupMainInsideWrapperBoxTopBtn click
|
// Function to handle popupMainInsideWrapperBoxTopBtn click
|
||||||
document.addEventListener('click', function(event) {
|
document.addEventListener('click', function(event) {
|
||||||
var clickedElement = event.target;
|
var clickedElement = event.target;
|
||||||
if (clickedElement.classList.contains('popupMainInsideWrapperBoxTopBtn')) {
|
var popupMainInsideWrapperBoxTopBtn = document.querySelector('.popupMainInsideWrapperBoxTopBtn');
|
||||||
|
|
||||||
|
// Check if the clicked element or its parent elements match the target
|
||||||
|
if (popupMainInsideWrapperBoxTopBtn.contains(clickedElement)) {
|
||||||
var popupLogin = document.getElementById('popupLogin');
|
var popupLogin = document.getElementById('popupLogin');
|
||||||
popupLogin.style.display = 'none';
|
popupLogin.style.display = 'none';
|
||||||
document.body.style.overflow = ''; // Re-enable scroll
|
document.body.style.overflow = ''; // Re-enable scroll
|
||||||
|
Loading…
Reference in New Issue
Block a user