Answer the question
In order to leave comments, you need to log in
Click event not firing on ios?
There is a script that calls a popup window.
But in ios safari it doesn't work.
There is information on the Internet that on mobile apple devices, the click event only fires for links.
And there are options for how to get around this moment, such as adding an onclick event to an element or a cursor pointer in css /
I tried these options, but I did not solve the problem.
here is the script itself:
let buttonItem = document.querySelectorAll('.button'),
overlayButton = document.querySelector('.overlay-button'),
closeButton = document.querySelector('.close-button');
buttonItem.forEach(item => {
item.addEventListener("click", e => {
overlayButton.style.display = 'block';
});
});
closeButton.addEventListener("click", e => {
overlayButton.style.display = 'none';
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question