Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help to disable horizontal swiping, please #363

Open
GennadyK opened this issue Mar 7, 2020 · 0 comments
Open

Need help to disable horizontal swiping, please #363

GennadyK opened this issue Mar 7, 2020 · 0 comments

Comments

@GennadyK
Copy link

GennadyK commented Mar 7, 2020

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant