windows phone: jquery mobile swipe not recognized

落花浮王杯 提交于 2019-12-23 03:14:04

问题


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

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