jQuery Mobile navigate or changePage?

后端 未结 3 1214
太阳男子
太阳男子 2021-01-02 18:49

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 addr

相关标签:
3条回答
  • 2021-01-02 19:18

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

    0 讨论(0)
  • 2021-01-02 19:20

    The other way would be to use:

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

    Link

    0 讨论(0)
  • 2021-01-02 19:27

    Use the Pagecontainer widget added in v1.4.

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

    e.g

    $(":mobile-pagecontainer").pagecontainer("change", "#nextpage",{ transition: "slide",role: "dialog" } );
    
    0 讨论(0)
提交回复
热议问题