jQuery Mobile: data-rel=“back” + data-transition does not work?

后端 未结 2 1308
臣服心动
臣服心动 2021-01-03 13:38

I created a jsfiddle that enables tabs using the navbar without changing the url hash: http://jsfiddle.net/ryanhaney/eLENj/

1) If I click on the \"page 1\" link from

2条回答
  •  伪装坚强ぢ
    2021-01-03 14:39

    I think I got it:

    • http://jsfiddle.net/E86M9/3/

    Had to reset the changePage default transition value

    $("a[data-role=tab]").each(function () {
        var anchor = $(this);
        anchor.bind("click", function () {
            $.mobile.changePage(anchor.attr("href"), {
                transition: "none",
                changeHash: false
            });
            return false;
        });
    });
    
    $("div[data-role=page]").bind("pagebeforeshow", function (e, data) {
        $.mobile.silentScroll(0);
        $.mobile.changePage.defaults.transition = 'slide'; // reset default here
    });​
    

    HTML

    Home

    Back

    Page 1

    Page 1 content

    Back

    Page 2

    Page 2 content

    Back

    Page 3

    Page 3 content

提交回复
热议问题