4

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>

Now i added the script directly above my body tag:

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

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

Sithys
  • 3,655
  • 8
  • 32
  • 67
  • check this http://stackoverflow.com/questions/19849637/how-to-use-fastclick-js-with-phonegap-and-jqm – Aravin Jun 16 '14 at 08:37
  • Okay i tried the solution over there. If i add $(document).on('pageinit', '.ui-page', function (event, data) { FastClick.attach(activePage); }); to my Page, it stops at the loading screen and nothing happens – Sithys Jun 16 '14 at 08:46

1 Answers1

5

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

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

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

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

});
Community
  • 1
  • 1
Gajotres
  • 57,309
  • 16
  • 102
  • 130
  • 1
    I'll try and let u know, if it works. A read a lot in your blog Gajotres, realy realy great work! It helped me in so many things, Thank you! – Sithys Jun 16 '14 at 08:58