JQuery mobile or changePage?

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

The problem is that since it is simplified, how do I access the other options that changePage offers? I would really like to use the {data} .navigate () part, but I would also like to set some parameters that I usually do with changePage (for example, transition, direction, etc.).

Currently, I have a "router" that listens for all navigation events, and then passes on any data that it receives to the next page (performing other simple logic, for example, setting up a view controller).

Are there hidden properties in [, options] that I could set simple things like direction and transition?

+6
source share
3 answers

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

Switching 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, reversal is still not implemented, false is applied.

+9
source

Another way would be to use:

 $.mobile.pageContainer.pagecontainer("change", "target", {transition: "flow", changeHash: false, reload: true}) 

Link

0
source

Use the Pagecontainer widget added in v1.4.

 $(":mobile-pagecontainer").pagecontainer("change", "jquerypageIdentifier",{ options in key value format } ); 

eg

 $(":mobile-pagecontainer").pagecontainer("change", "#nextpage",{ transition: "slide",role: "dialog" } ); 
0
source

Source: https://habr.com/ru/post/945293/


All Articles