Jquery mobile 使用$.mobile.changePage应用jquery移动页面转换
因此,我试图实现的是,在手动创建页面更改时应用任何页面转换 比如说,在我的网页上,我这样做,当用户向右滑动时,网站会转到第二个页面……就像这样Jquery mobile 使用$.mobile.changePage应用jquery移动页面转换,jquery-mobile,Jquery Mobile,因此,我试图实现的是,在手动创建页面更改时应用任何页面转换 比如说,在我的网页上,我这样做,当用户向右滑动时,网站会转到第二个页面……就像这样 $('#firstPage').bind("swiperight", function(){ //alert("swiped right on the body element"); $.mobile.changePage('#secondPage'); }); 现在我想给这个函数附加
$('#firstPage').bind("swiperight", function(){
//alert("swiped right on the body element");
$.mobile.changePage('#secondPage');
});
现在我想给这个函数附加一个页面转换。如果它是在一个实际的链接上,那么人们会应用一个数据转换
,但是由于这个页面更改是手动创建的,我想知道如何向它附加一个转换
例如,我试过
$('#firstPage').bind("swiperight", function(){
//alert("swiped right on the body element");
$.mobile.changePage('#secondPage','flip');
});
等,但没有用,有什么想法我将如何把这付诸实施?
感谢您的高级支持。尝试将
bind
替换为上的:
$('#firstPage').on("swiperight", function(){
//alert("swiped right on the body element");
$.mobile.changePage('#secondPage','flip');
});
我遇到了类似的问题,这对我来说很有效。您几乎已经得到了它,您只需要在{}
括号内声明函数的第二个参数(您的选项):
$('#firstPage').bind("swiperight", function(){
//alert("swiped right on the body element");
$.mobile.changePage( "#secondPage", { transition: "flip"} );
});
试试$.mobile.changePage(“#secondPage”,{transition:“flip”})代码>是的,就是这样,把它挂起来,这样我就可以接受了。谢谢