I want to detect if users swipe from the edge or not before I open the panel with $("#panel").panel("open");
. Here is the code
$("#main").on("swiperight",function(event){
var data = event.originalEvent.touches ? event.originalEvent.touches[0] : event,
coords = [data.pageX, data.pageY];
console.log(coords);
});
However the coords
didn't return anything because I got error:
Uncaught TypeError: Cannot read property 'touches' of undefined
So is there a way to get coordinate when swipe happens?
Or is there an easy way to detect if the staring position is from the left edge instead?
Thanks.