问题
I'm making an HTML + jquery mobile app. It works fine on my pc but when I try it out on my windows phone the swipe event doesn't seem to get fired..
$('div.ui-page').live("swipeleft", function () {
goToNextPage()
});
回答1:
Windows Phone 7/IE9 does not support mousemove event so there is not way for jquery mobile to recognize swipe event.
Some mobile frameworks like Apache Cordova (PhoneGap) provide workaround for this by adding special shim between native (silverlight) touch events and web browser control to fix missing mouse events. Demo
Update
This works fine on Windows Phone 8 since it supports mousemove.
回答2:
Tested the jquery mobile swipe example on a Lumia 920, and it worked perfectly. So trust it works well for WP8 devices. http://jquerymobile.com/demos/1.3.0/docs/examples/swipe/swipe-page.html. I actually used a slide menu plugin with swipe function and it worked on the Lumia 920. Here is the link to the plugin : https://github.com/tegansnyder/JQuery-Mobile-Slide-Menu
来源:https://stackoverflow.com/questions/14958248/windows-phone-jquery-mobile-swipe-not-recognized