Andre
Andre

Reputation: 145

Quick click button in Phonegap

I started to learn phonegap and I want to try make a simple application using a button and a text. I've tried do it and it works on my Android. The problem is, there are delay when I clicked the button. Is there any solution to remove the delay and make it like a flash button that can be clicked rapidly?

Thank You

Upvotes: 2

Views: 92

Answers (1)

Catalin MUNTEANU
Catalin MUNTEANU

Reputation: 5634

FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers.

The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.

Official Page

You must include it in the page:

<script type='application/javascript' src='/path/to/fastclick.js'></script>

Then call it after the DOM is loaded:

window.addEventListener('load', function() {
    new FastClick(document.body);
}, false);

Upvotes: 1

Related Questions