justinmc / jquery.mobile.fastButtons

Speed up click events in jQueryMobile
Other
12 stars 4 forks source link

Not working with jqm 1.3.1 and jquery 1.9.1 #2

Closed jedwood closed 11 years ago

jedwood commented 11 years ago

Unless I'm doing something wrong. No errors, it just seems to keep the click delay.

Any ideas?

justinmc commented 11 years ago

I just updated the project to jqm 1.3.1 and jQuery 1.9.1 to test and it seems to work fine on my Android phone. Take a look at the metrics page and see what results you get on your device: http://www.justinmccandless.com/demos/jquery.mobile.fastButtons/index.html

If the metrics page works on your device, make sure you check the order that you're including the scripts. Should be jQuery, then mobile, then the plugin. Also maybe try it on a very simple page first, like similar to the metrics page, to be sure that the delay isn't coming from an ajax request or something else.

Jqm can also be pretty finicky about vclick in some situations, post back and let me know how you're trying to use it if none of the above helps.

jedwood commented 11 years ago

Thanks for the quick response Justin. When viewed through my iPhone and the iPhone Simulator, that initial test page does show the difference in time as expected. However, when I go to the example "DOES" page the delay is still there.

Maybe it's an iOS 6.x issue? https://github.com/ftlabs/fastclick/issues/104

fwiw, when I throw a log statement inside the for (var i... loop, nothing gets logged. I'm using a very simple 'single page' page with no other ajax, and have ensured that the 3 files are loading in correct order. I've also tried loading them both in the <head> and at the bottom of the </body>

justinmc commented 11 years ago

Good find, I think I've fixed the bug in the latest commit SHA e5caee02f35bf1f32825b417efe6791d8df28826. It seemed like it actually was happening after the jqm update, not just because of iOS 6.

I updated the metrics page as well, so you can give it a quick test there to make sure it's resolved. You should also be able to see the for loop iterating now when you have click events on the page.

jedwood commented 11 years ago

Working great for links, and I can see the logging within the iterations. Unfortunately, it makes buttons in the header totally unresponsive, and as luck would have it that was my primary use case; getting that side menu to slide out immediately upon click.

Any ideas? Sorry I'm not very familiar with the guts of jqm and can't be or more help. :/

justinmc commented 11 years ago

Could you paste the code for a button that doesn't work? I can't reproduce it by trying a few buttons in the header.

For example, if you just paste this into the header of the first page on example_fast.html it works:

<a href="#fast2">Go to a new page quickly</a>

Also make sure that the button does work when you are not using fastbuttons. Watch out for the problem where buttons won't work if you are linking to a multipage document with ajax.