今天终于学会了下拉刷新,上拉刷新
<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);
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。