安卓手机下拉网页出现"由QQ浏览器XX提供技术支持",导致下拉刷新失效解决方案

 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});

 

posted @ 2020-03-07 18:01  yiruiheng  阅读(747)  评论(0编辑  收藏  举报