Skip to content

Need help to disable horizontal swiping, please #363

@GennadyK

Description

@GennadyK

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):

<script> $(document).ready(function() { $("body").swipe( { // this code to support toggleBars on single tap tap:function(event, target) { if ($(target).hasClass('baker-prevent-navigation') || $(target).hasClass('swiper-pagination-bullet') || $(target).prop('tagName').toLowerCase() == 'area' || $(target).parents('area').length > 0) { return; } window.location.href = 'book://toggleBars'; // toggleBars is case-sensitive!!! }, threshold:5 }); }); </script>

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions