纯JS实现下拉刷新
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) {
location.reload()
}
}
targetTouches: 当前对象上所有触摸点的列表;