. Advertisement .
..3..
. Advertisement .
..4..
I would like to consult everyone on the matter of “swipe left to view the next page”
When using the JQuery swipe event, I realized that ‘jumping’ would have been completed as shown below:
$("#container").on("swipe", function(event){
if(nav.current == 2){ //if current page is #2
nav.to(5); //jump to page #5
}
});
I found whether swiping left or right activates on page #2
, the document will go to page #5
However, When I run the code like this:
$("#container").on("swipeLeft", function(){
if(nav.current == 2){ //if current page is #2
nav.to(5); //jump to page #5
}
});
The code does not work as I expect, and the swipe gesture works just jump to page #2
.
I suppose the swiping binding navigation behavior overrides the swipeLeft
code. Is it possible? Do you have any suggestions for making a document leap when a swipeLeft/swipeRight
event occurs?
My advise is that you should use the touchSwipe library for swipeLeft (and swipeRight). It has syntax like the below code:
It’s also possible that you’ll need to get rid of any existing swiping.