如何在photoswipe中捕获swipe事件?
我尝试了以下几种方法。
var pSwipe = window.Code.PhotoSwipe.attach($(arrGallery), options);
pSwipe.show(0);
pSwipe.addEventHandler(window.Code.PhotoSwipe.ActionTypes.swipeLeft, function (e) {
alert('swipe left');
});但是它没有捕捉到事件吗?
发布于 2014-07-06 15:18:19
以下是解决方案:
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;
}
});https://stackoverflow.com/questions/24591459
复制相似问题