mattbryson / TouchSwipe-Jquery-Plugin

TouchSwipe is a jquery plugin to be used with jQuery on touch input devices such as iPad, iPhone etc.
http://labs.rampinteractive.co.uk/touchSwipe/
Other
4.05k stars 1.68k forks source link

Need help to disable horizontal swiping, please #363

Open GennadyK opened 4 years ago

GennadyK commented 4 years ago

Hi, I'm currently using TouchSwipe (version 1.6.18) to toggle controls inside the iOS app by single tap vs app's double-tap (sorry, none of the formatting options for code worked):

Now on some pages I need to disable supported by the app swiping between the pages. This code disables the very 1st swipe, but not the consecutive: $(function() {
//Enable swiping... $("#test").swipe( { swipeStatus:function(event, phase, direction, distance, fingerCount) { var str = ""; switch (phase) { case "start" : str="Started"; break; case "move" : str="You have moved " + distance +" pixels, past 200 and the handler will fire"; break; case "end" : str="Handler fired, you swiped " + direction; break; case "cancel" : str="cancel handler fired"; break; }

      $(this).text(str);
      //This will cancel the current swipe and immediately re run this handler with a cancel event
      return false;
    }
  });
});

Could someone please help on how to make it work after the 1st time and how to add that additional code inside already working code for tap?

Thanks a lot!