如何使用FastClick与jQuery Mobile正确的方式? [英] How to use FastClick with jQuery Mobile the right way?

查看:344
本文介绍了如何使用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正确的方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆