使用hammerjs,我如何向左/向右滑动并显示集合中的下一个文档(MeteorJS)



我想做的事情听起来很简单。基本上,在我的手机应用程序上,我希望能够使用chriswessels:hammer滑动查看收藏的下一个文档。现在,当我滑动时,什么都不会发生,但代码允许我滑动。

Template.auctionDetails.gestures({
  'swipeleft #ascensorBuilding': function (event, template) {
    alert('swipe left');
    event.preventDefault();
    return AuctionDeals.find(_id).next();
  },
  'swiperight #ascensorBuilding': function (event, template) {
    alert('swipe right');
    event.preventDefault();
    return AuctionDeals.find(_id).next();
  }
});

所以,当你向左滑动时,你也可以向右滑动,你最好尝试另一种方法来解决你的问题。盖茨也许可以帮你,祝你好运。。

最新更新