Hammer.js: swipe up and swipe down not working

Created on 7 Oct 2014  路  5Comments  路  Source: hammerjs/hammer.js

Hi am developing an application with marionette and hammer,swipe up and swipe down functions are not invoked,where as swipe left and swipe right is invoked.

Most helpful comment

Hello @chengqiang1992

I've just fixed my issue by setting:

```javascript
var hammertime = new Hammer(document.body);

hammertime.get('swipe').set({ direction: Hammer.DIRECTION_ALL });
`````

I hope it helps.

All 5 comments

I have the same issue. When i try to swipe up and down it doesn't work. Swipe Left / Right work on Chrome 38, but when i try on a touch screen device as tablet or smartphone, it is not working.

So in a Chrome 38 for a PC swipe right and left work, but it is not the case for the swipe up and down
In a tablet or a smartphone, no swipe work.

Probably this;
http://hammerjs.github.io/getting-started/

By default it adds a set of tap, doubletap, press, horizontal pan and swipe, and the multi-touch pinch and rotate recognizers. The pinch and rotate recognizers are disabled by default because they would make the element blocking, but you can enable them by calling:

hammertime.get('pinch').set({ enable: true });
hammertime.get('rotate').set({ enable: true });

Enabling vertical or all directions for the pan and swipe recognizers:

hammertime.get('pan').set({ direction: Hammer.DIRECTION_ALL });
hammertime.get('swipe').set({ direction: Hammer.DIRECTION_VERTICAL });

I just want to know how everyone resolved this problem. When i try to swipe up and down it doesn't work. Swipe Left / Right work. But i have so many content in the list.

Hello @chengqiang1992

I've just fixed my issue by setting:

```javascript
var hammertime = new Hammer(document.body);

hammertime.get('swipe').set({ direction: Hammer.DIRECTION_ALL });
`````

I hope it helps.

@jaysalvat if you do this ,the body can not scroll . but if add touchAction ='pan-y' ,swipe will not work. and please help me . many thanks

Was this page helpful?
0 / 5 - 0 ratings