Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Mobile navigate or changePage?

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.

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).

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

like image 217
Chris Avatar asked May 17 '13 19:05

Chris


1 Answers

$.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" });

Working example: http://jsfiddle.net/Gajotres/g5vAN/

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

like image 59
Gajotres Avatar answered Nov 03 '22 00:11

Gajotres