0

我在 ipad 的网络应用程序上设置了滑动功能,这样一旦用户用手指向右滑动,它就会将他们带到他们访问的最后一页。那个javascript看起来像这样

    <script>
$(document).bind('swiperight', function () {
        history.back();
    });</script>

现在考虑到这一点,如果我想让函数更精确,以便它更改为特定页面,我会合并 JQM 更改页面功能吗?

    <script>
$(document).bind('swiperight', function () {
       $.mobile.changePage( "#home", { transition: "slide"} );
    });</script>

我将把 data-direction="reverse" 的属性放在哪里?

4

1 回答 1

1

它应该如下所示:

$(document).bind('swiperight', function () {
    $.mobile.changePage("#home", {
        transition: "slide",
        reverse: true
    });
});
于 2013-02-12T14:07:52.850 回答