当pullToRefresh对象加载了很多数据后,清空内容,重新加载时,出现空白
mui.ready(function() {
//循环初始化所有下拉刷新,上拉加载。
var ss = document.getElementById("ss");
mui(ss).pullToRefresh({
up: {
auto:1,
callback: function() {
// this is ss
ajax_getorders(this);
}
}
});
mui(".mui-scroll").on('tap','.mui-control-item', function(e){
//console.log(e);
getorder(this);
});
});
function getorder(self){
//内容区滚动到顶部
//mui('#ss').pullRefresh().scrollTo(0,0,100);
if(self.className.indexOf("mui-active") != -1){
return;
}
// clear dom, reset page,trigger pull(get data, add dom)
document.getElementById("neworder").innerHTML ="" ;
document.getElementById("nextPage").value = "";
document.getElementById("currentPage").value = "";
if(self.title == '今天'){
document.getElementById("tagid").value = 0;
}else if(self.title == '本月'){
document.getElementById("tagid").value = 1;
}else if(self.title == '三个月内'){
document.getElementById("tagid").value = 2;
}else if(self.title == '今年'){
document.getElementById("tagid").value = 3;
}
getPullRefreshApi("ss").pullUpLoading();
}
function getPullRefreshApi(id){
return mui.data[document.getElementById(id).getAttribute("data-pullToRefresh")];
}
2***@qq.com
感谢!找了半天
2018-07-05 16:38