Only swipeone is working with jGestures

前端 未结 7 2423
抹茶落季
抹茶落季 2021-02-10 09:56

I\'m trying to implement touch evens with jGestures. swipeone works fine but anything else (swipeleft, swiperight etc) is not firing.

7条回答
  •  花落未央
    2021-02-10 10:25

    I was just looking for the same thing and figured out that you can try all in the same function like so:

    $("#wrap").on('swipeleft swipeleftup swipeleftdown', function(e){
        doSomething();
    });
    

    as well as the equivalent for right:

    $("#wrap").on('swiperight swiperightup swiperightdown', function(e){
        doSomething();
    });
    

    You can list multiple events together with the on method.

提交回复
热议问题