点击iOs和Android

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了点击iOs和Android相关的知识,希望对你有一定的参考价值。

Here is a code that force to fire a click on ios devices, where there is first a touchstart event
  1. var UA = navigator.userAgent,
  2. iOS = !!(UA.match(/iPad|iPhone|android/i));
  3. $(this).on("click", function(){
  4. // do somthing
  5. });
  6. if (iOS) {
  7. $(document).on('touchstart', function (e) {
  8. e.target.click();
  9. });
  10. }

以上是关于点击iOs和Android的主要内容,如果未能解决你的问题,请参考以下文章