watt watt - 3 months ago 21
CSS Question

Mobile Safari sometimes does not trigger the click event

This is a dynamic JavaScript application I am working on. I have many

anchor elements that have a class. When that class is clicked, something should happen. This works fine in Firefox, Chrome, IE, but in some cases the click event is not triggered on mobile Safari (iPad and iPhone).

These elements all have exactly the same CSS, it's just their position that differs (they are in different containers).

I tried various solutions that I found here but with no luck. For instance:

Do you have any other idea that might help me find a solution to this? Why does the click event triggers only in some cases?



Have you tried this?? This is because ios doesn't fire the click event sometimes, only recognizes the touch event

$(document).on('touchstart click', [Selector], [ Event ]