How to use FastClick.js with Phonegap and JQM?

泪湿孤枕 提交于 2019-11-30 06:51:36

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

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);
});
Simon_Weaver

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?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!