【问题标题】:Photoswipe capture swipe eventPhotoswipe 捕捉滑动事件
【发布时间】:2014-07-05 23:41:18
【问题描述】:

如何在 photoswipe 中捕捉滑动事件?

我尝试了以下...

var pSwipe = window.Code.PhotoSwipe.attach($(arrGallery), options);
pSwipe.show(0);
pSwipe.addEventHandler(window.Code.PhotoSwipe.ActionTypes.swipeLeft, function (e) {
    alert('swipe left');
});

但它没有捕捉到事件?

【问题讨论】:

    标签: jquery photoswipe


    【解决方案1】:

    解决办法如下:

    var pSwipe = window.Code.PhotoSwipe.attach($(arrGallery), options);
    pSwipe.show(0);
    pSwipe.addEventHandler(window.Code.PhotoSwipe.EventTypes.onTouch, function (e) {
        switch (e.action) {
            case 'swipeDown':
                alert('you swiped down');
                break;
            case 'swipeUp':
                alert('you swiped up');
                break;
         }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-06-07
      • 2017-07-27
      • 1970-01-01
      • 2012-12-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多