jQuery Mobile 导航或更改页面? [英] jQuery Mobile navigate or changePage?

查看:17
本文介绍了jQuery Mobile 导航或更改页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着 jQuery Mobile 1.3 的到来,添加了 .navigate() 函数.我听说这是更改页面的推荐方式,似乎他们解决了页面之间传输数据的问题.

With the arrival of jQuery Mobile 1.3, the .navigate() function has been added. I've heard that is the recommended way to change pages, and it seems they addressed the issues of transferring data between pages.

问题是,既然已经简化了,我该如何访问 changePage 提供的其他选项?我真的很想使用 .navigate() 的 {data} 部分,但我也想设置一些我通常使用 changePage 做的选项(例如过渡、方向等).

The problem is, since it has been simplified, how do I access the other options that changePage offered? I would really like to use the {data} portion of the .navigate() but I would also like to set a few options that I do normally with changePage (such as transition, direction, etc).

我目前有一个路由器",它侦听所有导航事件,然后将它接收到的任何数据传递到下一页(也执行一些其他简单的逻辑,例如设置视图控制器).

I currently have a "router" that listens for all navigate events, then passes along any data that it receives on to the next page (doing some other simple logic as well, like setting up the views controller).

[,options] 中是否有一些隐藏属性,我可以设置简单的东西,比如方向和过渡?

Is there some hidden properties in the [,options] that I would be able to set up simple things like direction and transition?

推荐答案

$.mobile.navigate 还是一个新功能,根据代码注释也是一个正在进行中.

$.mobile.navigate is still a new function, according to code comments it is also a work in progress.

转换在隐藏选项中处于活动状态;

Transition is active among hidden options;

$.mobile.navigate( "#bar", { transition : "slide", info: "info about the #bar hash" });

工作示例:http://jsfiddle.net/Gajotres/g5vAN/

另一方面,仍然没有实现对方向反向的更改,应用默认的 false 值.

On the other hand, change to direction reverse is still not implemented, default false value is applied.

这篇关于jQuery Mobile 导航或更改页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆