【问题标题】:Calling other HTML file (hyperlink) on Swipe gesture with TouchSwipe plugin使用 TouchSwipe 插件在滑动手势上调用其他 HTML 文件(超链接)
【发布时间】:2013-05-09 16:51:00
【问题描述】:

我正在查看 TouchSwipe 插件 - http://labs.rampinteractive.co.uk/touchSwipe/demos/,我想知道如何在滑动手势上调用其他 HTML 文件?

所以我有一个 div,TouchSwipe 工作的地方。在向左滑动时,我希望浏览器打开一个 html 文件,如超链接,向右滑动,打开另一个。

所以代码是这样的:

$("#swipe").swipe({
    swipeLeft:function(event, direction, distance, duration, fingerCount) {
    }
});

谢谢大家的建议和帮助!

【问题讨论】:

    标签: jquery html touch swipe swipe-gesture


    【解决方案1】:

    我认为应该这样做,假设您在 1.html 和 2.html 中都有 id="swipe"。

    // ------------
    // 1.html.
    // ------------
    
    $("#swipe").bind("swipeleft",function(event) {
        $("#div").load( "2.html");
    });
    
    // ------------
    // 2.html.
    // ------------
    $("#swipe").bind("swiperight",function(event) {
        $("#div").load( "1.html");
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多