简体   繁体   中英

Disable double click in Android PhoneGap App

I'm using PhoneGap for building an Android App. The PhoneGap app loads an WebViwe with my site. I have problems when user double click on items and makes me some problems...

How can I cancel the option of double clicking? I mean each double tap would result one tap.

This could be two different issues. In Android the webview has a click delay that waits for double click actions and adds 300ms before completing click actions. For that you can use the JS library fastclick.js get it here

To use it add this:

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

You could also add an event handler for dblclick with this:

window.addEventLister('dblclick', someFunctionOnDblClick, false);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM