var startY = 0,endY = 0,offset = 0; document.addEventListener("touchstart", function (e) { var touch = e.touches[0]; startY = Number(touch.pageY); }) document.addEventListener(‘touchmove‘, function(e) { var obj = document.documentElement, touch = e.touches[0]; if (obj.scrollTop == 0) { if (touch.clientY > startY) {
// 下拉到顶 e.preventDefault(); } else { e.stopPropagation(); } } },{passive:false});