<script>
var windowheight = $ (window). Height (),
$body = $ ("body");
Console.log ($ (window). Height ());
Console.log ($ (' body '). Height ());
$body. CSS ("height", windowheight);
Console.log ($ (' body '). Height ());
$ ("Body"). On ("Touchstart", function (e) {
E.preventdefault ();
StartX = E.originalevent.changedtouches[0].pagex,
Starty = E.originalevent.changedtouches[0].pagey;
});
$ ("Body"). On ("Touchmove", function (e) {
E.preventdefault ();
Moveendx = E.originalevent.changedtouches[0].pagex,
Moveendy = E.originalevent.changedtouches[0].pagey,
X = Moveendx-startx,
Y = Moveendy-starty;
if (Math.Abs (x) > Math.Abs (Y) && X > 10) {
Alert ("Left 2 Right");
}
else if (Math.Abs (x) > Math.Abs (Y) && X < 10) {
Alert ("Right 2 Left");
}
else if (Math.Abs (Y) > Math.Abs (X) && y > 10) {
Alert ("Top 2 Bottom");
}
else if (Math.Abs (Y) > Math.Abs (X) && y < 10) {
Alert ("Bottom 2 top");
}
else{
Alert ("Just touch");
}
});
</script>
Mobile Touch Swipe Event