如何使用FastClick与jQuery Mobile正确的方式?

编程入门 行业动态 更新时间:2024-10-15 04:22:39
本文介绍了如何使用FastClick与jQuery Mobile正确的方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在iOS应用程式中使用FastClick。我下载了fastclick并将其包含在我的头像:

i would like to use FastClick in an Application for iOS. I downloaded the fastclick and included it into my header which looks like:

<meta name="format-detection" content="telephone=no" /> <meta charset="utf-8" /> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1" /> <link rel="stylesheet" type="text/css" href="css/jquery.mobile-1.4.2.css" /> <link rel="stylesheet" type="text/css" href="css/stylesheet.css" /> <script type="text/javascript" src="js/jquery-1.11.1.js"></script> <script type="text/javascript" src="js/jquery.mobile-1.4.2.js"></script> <script type="text/javascript" src="js/fastclick.js"></script> <script type="text/javascript" src="js/jquery.simpleWeather.min.js"></script> <script type="text/javascript" charset="utf-8" src="cordova.js"></script>

现在我在我的body标签上面添加了脚本:

Now i added the script directly above my body tag:

<script> $(function() { FastClick.attach(document.body); }); </script>

但我没有消除300ms延迟...它仍然在那里。

But i haven't eliminated the 300ms delay... its still there. Do i use it the wrong way?

推荐答案

您不需要使用第三方插件(如Fastclick)。

You don't need to use 3rd party plugins like Fastclick.

jQuery Mobile已经使用vclick事件解决了这个问题。它适用于桌面设备和移动设备,并且没有300毫秒的延迟。

jQuery Mobile has already solved this problem with vclick event. It works on desktop and mobile devices and don't have 300ms delay.

阅读我的其他 answer 。如果您想了解更多信息。

Read my other answer if you want to find out more.

$(document).on('vclick', '#someButton', function(){ });

更多推荐

如何使用FastClick与jQuery Mobile正确的方式?

本文发布于:2023-10-28 04:32:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535530.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   正确   方式   jQuery   FastClick

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!