直接復制粘貼 放在頁面中即可
<script>
window.onload = function(){
window.addEventListener('touchstart', touchstart, false);
window.addEventListener('touchmove', touchMove, false);
}
var _start = 0;
var _end = 0;
function touchstart(event) {
var touch = event.targetTouches[0];
_start = touch.pageY;
}
function touchMove(event){
var touch = event.targetTouches[0];
_end = ( touch.pageY - _start);
//下滑才執行操作
if(_end > 200){ //200即手機下滑屏幕的距離,超過200則執行刷新動作
location.reload();
}
}
</script>
