1,列表向上滑到底部时,再下拉想返回顶部时就执行下拉(感觉无法滑动到顶部了,一下拉就就触发刷新事件)。
2,这句mui('#refreshContainer').pullRefresh().endPullupToRefresh((++count > 2));是什么意思呢?
<!--内容列表-->
<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<!--数据列表-->
<ul class="mui-table-view mui-table-view-chevron mian-list" id="search_list">
</ul>
</div>
</div>
mui.init({
pullRefresh: {
container: "#refreshContainer",
down: {
// contentdown: "下拉可以刷新",
// contentover: "释放立即刷新",
// contentrefresh: "正在刷新...",
callback: handleFresh
},
up: {
contentrefresh: "正在加载...",
// contentnomore: '没有更多数据了',
callback: handleLoad
}
}
});
window.onload = function() {
var data = {
"dbteacher": "1"
};
handleData("search_list", "http://192.168.1.11/", data);
mui.plusReady(function() {
//关闭等待框
plus.nativeUI.closeWaiting();
//显示当前页面
mui.currentWebview.show();
});
}
var count = 0;
function handleFresh() {
setTimeout(function() {
var table = document.body.querySelector('.mui-table-view');
var cells = document.body.querySelectorAll('.mui-table-view-cell');
for (var i = cells.length, len = i + 3; i < len; i++) {
var li = document.createElement('li');
li.className = 'mui-table-view-cell';
li.innerHTML = '<a class="mui-navigate-right">Item ' + (i + 1) + '</a>';
//下拉刷新,新纪录插到最前面;
table.insertBefore(li, table.firstChild);
}
mui('#refreshContainer').pullRefresh().endPulldownToRefresh(); //refresh completed
}, 1500);
}
function handleLoad() {
setTimeout(function() {
mui('#refreshContainer').pullRefresh().endPullupToRefresh((++count > 2));
var table = document.body.querySelector('.mui-table-view');
var cells = document.body.querySelectorAll('.mui-table-view-cell');
for (var i = cells.length, len = i + 20; i < len; i++) {
var li = document.createElement('li');
li.className = 'mui-table-view-cell';
li.innerHTML = '<a class="mui-navigate-right">Item ' + (i + 1) + '</a>';
table.appendChild(li);
}
}, 1500);
}
632013207
麻烦问下解决这个问题了吗
2019-01-16 13:54