0

Is there any way to disable swipe, for example on a click event and then enable swipe again? I know you can use stopPropagation, but how do you then enable it again?

Thanks

J. Sveum
  • 29
  • 1
  • 7

1 Answers1

0

This has already been answered partially here: https://stackoverflow.com/a/9325428/4408994

The recommendation by wot is the correct method. Instead of stopping the propagation of events, namespace the events you bind so that you can bind/unbind them as you need.

For example, bind like this (to detect swipes):

jQuery('body').on('swipeleft.my_event_namespace_name', function(){//code});

Then unbind like this (to disable detection of swipes):

jQuery('body').off('swipeleft.my_event_namespace_name');

You can repeat this binding and unbinding as much as you need.

Community
  • 1
  • 1
James Collier
  • 157
  • 10