··· <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello MUI</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="../css/mui.min.css">
<style>
html,
body {
background-color: #efeff4;
}
.title {
padding: 20px 15px 10px;
color: #6d6d72;
font-size: 15px;
background-color: #fff;
}
.news-list {
top: 0;
}
.silder-list-attention {
z-index: 999999999;
}
.silder-list-attention {
height: 160px;
padding: .1rem .1rem;
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow-x: scroll;
list-style: none;
display: -webkit-box;
z-index: 1000;
}
.silder-list-attention li {
width: 100px;
height: 150px;
font-size: .34rem;
padding: 0rem .24rem;
color: #505050bf;
border: 1px solid #DFDFDF;
text-align: center;
margin: 2px;
}
</style>
</head>
<body>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<div class="title">
这是webview模式选项卡中的第1个子页面
</div>
<div class="news-list">
<ul class="silder-list-attention">
<li>
<p class="scroll-title">测试</p>
</li>
<li>
<p class="scroll-title">测试</p>
</li>
<li>
<p class="scroll-title">测试</p>
</li>
<li>
<p class="scroll-title">测试</p>
</li>
<li>
<p class="scroll-title">测试</p>
</li>
<li>
<p class="scroll-title">测试</p>
</li>
</ul>
</div>
</div>
</div>
<script src="../js/mui.min.js"></script>
<script>
mui.init({
swipeBack: false,
keyEventBind: {
backbutton: false //关闭back按键监听
},
pullRefresh: {
container: '#pullrefresh',
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
var count = 0;
/**
* 上拉加载具体业务实现
*/
function pullupRefresh() {
setTimeout(function() {
mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count > 2)); //参数为true代表没有更多数据了。
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);
}
}, 1000);
}
</script>
</body>
</html>···
0 个回复