Module 6: Avoiding the 300ms Click Delay

Overview

Steps

  1. Test the application on your iOS device or in the iOS emulator (this will not work on the browser). Tap the Help button, and notice the delay before the dialog appears.

    This delay occurs because the operating system is waiting roughly 300ms to see if the user is going to tap the target again (and therefore perform a double-tap).

  2. In index.html, add the following script tag:

    <script src="lib/fastclick.js"></script>
    

    FastClick is an open source library built by the Financial Times. More information here.

  3. In app.js, register FastClick inside the deviceready event handler.

    FastClick.attach(document.body);
    
  4. Test the application by clicking the help button. The message should now appear without delay.