/ / add sliding left and right toggle real events
var windowHeight = $(window).height(),
$body = $("body");
$body.css("height", windowHeight); //
$("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 > 0 ) {
window.location.href="/<?php echo $this->school_flag;?>/main/bk";
}
else if ( Math.abs(X) > Math.abs(Y) && X < 0 ) {
window.location.href="/<?php echo $this->school_flag;?>/main/wd";
}
});-sharp-sharp-sharp
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)