Hi there.
I'm trying to make the document jump to a specific page when a scrollLeft event is triggered on another, specific, page (and, on the other side, to another page when a scrollRight event occurs).
I found out that 'jumping' could be done by using JQuery swipe event, like that:
$("#container").on("swipe", function(event){
if(nav.current == 2){ //if current page is #2
nav.to(5); //jump to page #5
}
});
This will make document jump to page #5 if a swipe (to left or to right) is triggered on page #2.
Instead, this code will not work (i.e.: swipe gesture just work as usual):
$("#container").on("swipeLeft", function(){
if(nav.current == 2){ //if current page is #2
nav.to(5); //jump to page #5
}
});
My guess: swipe binding navigation behavior overrides swipeLeft code. Could be?
Do you have any advice about how could I make document jump if a swipeLeft/swipeRight event occurs?