【问题标题】:Swipe to previous / next post URL?滑动到上一个/下一个帖子 URL?
【发布时间】:2016-09-27 04:38:58
【问题描述】:

是否可以在移动/平板设备上使用滑动手势导航到上一个/下一个帖子?

例如,使用特定的 id 或类来关注 prev / next 链接。

我可以将任何 ID 或类放入为上一个和下一个帖子 URL 动态生成的链接,如下所示:

<a id="prev-link" class="left-previous" href="">some link</a>
<a id="next-link" class="right-next" href="">other link</a>

我猜它可以用 jQuery 来完成,还有更多。这是某种方式告诉它在左右滑动手势上使用一些 id/class 来打开链接吗?

【问题讨论】:

    标签: javascript jquery jquery-mobile swipe swipe-gesture


    【解决方案1】:

    如果我理解正确,您可以使用 jQuery Mobile 库 (https://jquerymobile.com/) 来处理滑动事件:

    $("selector").on("swipe",function(event){...})
    $("selector").on("swipeleft",function(event){...})
    $("selector").on("swiperight",function(event){...})
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-15
      • 2015-10-18
      • 1970-01-01
      • 2017-10-26
      • 1970-01-01
      • 1970-01-01
      • 2016-12-10
      • 1970-01-01
      相关资源
      最近更新 更多