<script type="text/javascript">
//全局变量,触摸开始位置
var startX = 0, startY = 0;

//touchstart事件
function touchSatrtFunc(evt) {
try {
//evt.preventDefault(); //阻止触摸时浏览器的缩放、滚动条滚动等
var touch = evt.touches[0]; //获取第一个触点
var y = Number(touch.pageY); //页面触点Y坐标
//记录触点初始位置

if (y < 370) {
window.location.href = window.location.href;
}
}
catch (e) {

}
}

//绑定事件
function bindEvent() {
document.addEventListener('touchstart', touchSatrtFunc, false);

}
//判断是否支持触摸事件
function isTouchDevice() {
try {
document.createEvent("TouchEvent");

bindEvent(); //绑定事件
}
catch (e) {
}
}
window.onload = isTouchDevice;
</script>

相关文章:

  • 2021-11-28
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2021-12-23
  • 2018-01-09
猜你喜欢
  • 2021-05-25
  • 2021-12-04
  • 2021-07-18
  • 2018-03-17
  • 2022-12-23
  • 2021-09-06
相关资源
相似解决方案