一个简单的实现! 记录下
<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
<header id="header" class="mui-bar mui-bar-nav">
<h1 class="mui-title">调度监控</h1>
<button id='setting' class=" mui-pull-right mui-btn-link">设置</button>
</header>
<div class="mui-content">
</div>
</div>
(function($, doc) {
$.init({
gestureConfig: {
longtap: true
},
pullRefresh : {
container:"#refreshContainer",//下拉刷新容器标识
down : {
style:'circle',//必选,下拉刷新样式
color:'#2BD009', //可选,下拉刷新控件颜色
height:'50px',//可选,默认50px.下拉刷新控件的高度,
range:'100px', //可选 默认100px,控件可下拉拖拽的范围
offset:'0px', //可选 默认0px,下拉刷新控件的起始位置
auto: true,//可选,默认false.首次加载自动上拉刷新一次
callback : function(){
callfunction(); //刷新执行的回调函数
},
}
}
});
function callfunction() {
loadPage();
setTimeout(function () {
//关闭‘正在刷新’的样式提示
mui('#refreshContainer').pullRefresh().endPulldownToRefresh();
}, 1000);
}
var loadPage = null;
var loadMark = null;
$.plusReady(function() {
var monitorMark = null;
loadPage = function(){
clearInterval(monitorMark);
//DO SOMETHING
console.log('loadPage ====================================');
monitorMark = setInterval(loadMark,2000);
}
loadMark = function(){
console.log('loadMark ====================================');
}
})