我有两个页面:index.html和right.html。
需要什么样的代码才能通过水平滑动屏幕从index.html转到right.html?
我正在使用jQuery Mobile
$(function()
{
$(document).on( "swipeleft", swipeleftHandler );
function swipeleftHandler( event )
{
// What is the code that should come here?
// And how can I design it so index.html slides to left
// and right.html comes to the middle?
}
});
答案 0 :(得分:0)
您需要预取页面,然后在使用jquery时更改页面,因此您的代码将是这样的:
$(document).on("swipeleft", "#indexId", function() {
$.mobile.loadPage("right.html");
$.mobile.changePage("right.html", { transition: "slide" });
});