'Web Development: Popup close button not working in Safari on iPhone
So, I have this newsletter-signup-popup window that has a close [X] button. The code to close it looks like this
$(document).on('click touchstart', '.ns-close-popup', this.closeSubscription.bind(this));
The close function only calls the jQuery function .fadeOut() on the element that needs to be closed.
This however, does not work in Safari on an iPhone. It works fine in Safari on a Mac Mini and also in Chrome on an Android phone. It also works fine in Chrome on Windows.
So my initial thought was that the problem was related to the touch so the touchstart event was added; I've also tried with touchend - for good measure, but neither seems to do the trick. Since it works fine on the Mac Mini as well as Windows I'm not under the impression that the code isn't being triggered correctly. Unless there's something different happening on an iPhone compared to a Mac Mini.
I'm trying to figure out what could cause this to not work specifically on an iPhone, but without luck. Any ideas or suggesions would be greatly appreciated, thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
