How to use FastClick.js with Phonegap and JQM?

后端 未结 3 380
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 05:07

I\'ve tried a few different ways to remove the 300ms delay due to the webkit browsers handling of touch events. The library, FastClick.js, seems to be the preferred method,

相关标签:
3条回答
  • 2020-12-30 05:26

    I can also think of another solution.. Note: I have not personally tried this..

    $(document).on('pageinit', '.ui-page', function (event, data)
    {
       FastClick.attach(activePage);
    });
    
    0 讨论(0)
  • 2020-12-30 05:29

    You should use the built in vclick event in jQuery Mobile - same idea as FastClick.

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

    Source: How to use FastClick with jQuery Mobile the right way?

    0 讨论(0)
  • 2020-12-30 05:30

    Try with the below code.

    function onBodyLoad()
    {       
        document.addEventListener("deviceready", onDeviceReady, false);
    
    }
    
    function onDeviceReady()
    {
      alert('test');
      FastClick.attach(document.body);
    }
    

    If everything is fine, you should be able to see the alert box.

    Have a look on http://phonegap-tips.com/articles/fast-touch-event-handling-eliminate-click-delay.html

    0 讨论(0)
提交回复
热议问题