问题
hope you can help me. I'm freaking out after spending several days trying to solve this problem.
My JavaScript mouse event functions don't work on iOS devices. I red this apple article and i added to my html tags this attribute: onclick="void(0)"
but it just doesn't want to work. i can trigger an alert message on any mouse events like this:
document.getElementById("el").addEventListener("mousedown", function(){
alert("Bla-Bla");
)};
but stuff like this inside the same eventlistener is not being executed:
document.getElementById("el").classList.remove("bla-class");
does somebody maybe know if there is a solution for this problem?
回答1:
The problem could not be on your code, the thing is that regularlly JavaScript is not eneble for browsers in IOS, so you can try go to settings > safaria > advanced > JavaScript and enable it, that's it, i hope this help you.
That life gives you good code
来源:https://stackoverflow.com/questions/37143619/some-javascript-functions-dont-work-on-ios-devices-iphone-ipad