function pullUp(targetName,minRange,myevent){
var pg=0
var targetName1="#"+targetName;
// $(targetName1).on(‘touchmove’,function(event){
// event.preventDefault();
// })
var mytarget=document.getElementById(targetName);
var startPos={};
var endPos={};
var touch;
mytarget.ontouchstart=function(event){
touch = event.targetTouches[0];
startPos = {x:touch.pageX,y:touch.pageY}
}
mytarget.ontouchmove = function(event){
if(event.targetTouches.length > 1){
return;
}
touch = event.targetTouches[0];
endPos = {x:touch.pageX,y:touch.pageY}
}
mytarget.ontouchend = function(){
//本次上拉只使用Y坐标,灵敏度为20像素
var range = startPos.y - endPos.y;
if(range>minRange){
if (typeof pullUpMain === "function") {
pullUpMain();
}
else{console.log("没有需要加载的项")}
}
}
}
//下拉刷新同理,略