一些常用api
2.1.进度框加载
showProgress
api.showProgress({
style : 'default',
animationType : 'fade',
title : '努力加载中...',
text : '先喝杯茶...',
modal : false
});
...
api.hideProgress();
* 通常在ajax请求发送前调用,展现为一个加载中的效果
* modal选择是否模态,模态时整个页面将不可交互。
* 在ajax请求返回结果后调用api.hideProgress(),关闭加载效果
2.2.打开frame/window
打开frame
api.openFrame({ name: type, url: './html/'+ type +'.html', bounces: true, vScrollBarEnabled: false, });
- bounces:页面是否弹动
- vScrollBarEnabled:是否显示垂直滚动条
打开window
api.openWin({ name: 'userLogin', url: './html/userLogin.html', vScrollBarEnabled:false });
2.3.下拉刷新
setRefreshHeaderInfo
api.setRefreshHeaderInfo({
visible: true,
loadingImg: 'widget://image/refresh.png',
bgColor: '#ccc',
textColor: '#fff',
textDown: '下拉刷新...',
textUp: '松开刷新...',
showTime: true
}, function(ret, err){
// 这里写重新渲染页面的方法
});
* 注意:当页面渲染完毕后要调用 api.refreshHeaderLoadDone() 方法恢复正常状态