今天终于学会了下拉刷新,上拉刷新

发布时间:2020-07-29 14:57:09 作者:cui_jinfeng
来源:网络 阅读:351

<div id="megBox">

  <div id="refreshbar" >下拉刷新。。</div>

</div>

var touchPoint={

      Y:0,

      Loading:false

}

function InitTouch(){

  var box=document.getElementById("megBox");

  box.addEventListener("touchstart",function(target){

        touchPoint.Y=target.targetTouches[0].pageY;

  },false);

  box.addEventListener("touchmove",function(target){

        if(!touchPoint.Loading){

           var distance=target.targetTouched[0].pageY-touchPoint.Y;

           if(distance>100){

              touchPoint.Loading=true;

              $("#refreshbar").height(30);

              setTimeout(function(){

              //刷新方法

               },2000);

           }

        }

  },false);

}

推荐阅读:
  1. 终于搞定了回家车票
  2. 终于通过了网工考试,

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

下拉刷新 上拉加载

上一篇:C++如何实现哈夫曼树编码解码

下一篇:oracle的启动与关闭原理-参数文件管理

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》