/ Published in: JavaScript

Here is a code that force to fire a click on iOS devices, where there is first a touchstart event
Expand |
Embed | Plain Text
var UA = navigator.userAgent, iOS = !!(UA.match(/iPad|iPhone|Android/i)); $(this).on("click", function(){ // do somthing }); if (iOS) { $(document).on('touchstart', function (e) { e.target.click(); }); }
Comments

You need to login to post a comment.
very useful info, thank you for sharing with us! wuxiaworld
Thanks for the info!
This article is very detailed and meticulous, I have read many articles on this topic, but for this article, you leave me a deep impression and practical application in my life. Thank you for sharing. [url=https://mapquestdirections.co]mapquest directions[/url]