【发布时间】:2014-03-01 11:04:06
【问题描述】:
我正在尝试使用滑动事件在页面之间导航,这是我的代码
$( document ).on( "swipeleft", page, function() {
$.mobile.changePage( "#"+next, { transition: "slide" },false );
}); // Navigate to next page when the "next" button is clicked
$( ".control .next", page ).on( "click", function() {
$.mobile.changePage( "#"+next, { transition: "slide" },false );
});
但滑动在 Android 设备上无法正常工作,我们将不胜感激任何帮助
提前致谢
【问题讨论】:
-
我认为
swipeleft不是默认jQuery 的事件。您可能不得不为此使用其他库... hammarjs 是流行的。 -
jQuery.mobile.changePage 自 jQuery Mobile 1.4.0 起已弃用,将在 1.5.0 中删除。请改用 pagecontainer 小部件的 change() 方法。
-
查看 jquerymobile 文档中的演示:demos.jquerymobile.com/1.4.0/swipe-page
-
@QuickFix 事件演示效果不佳
-
其实我注意到滑动行为很大程度上取决于android的版本。
标签: jquery jquery-mobile swipe