Hello..
I'm having trouble finding a very basic swipe example.. .. I don't need to drag anything around.. .. I just need to listen to a swipe up or down and call the appropriate function.
I've got a little something now based off of some examples, but again.. .. i end up dragging the stage round when I just want to listen for a swipe direction.
Any suggestions?
Here is my simple code:
var DD = Draggable.create($("#stage"),
{
type:'y',
lockAxis:true,
onRelease:function()
{
var dir = this.getDirection("start");
console.log('swipe! onDragStart() ' + dir)
if (dir === "up"){
next();
}else if(dir === "down"){
prev();
}
}
});
ALSO, I tried attaching it to the body, but the only direction that would log was "right".
Thanks,