字消失了,灰色背景好像卡住了一样,需要滑动一下才能消失,代码如下:
主页面代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></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">
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
<style>
html,
body {
background-color: #efeff4;
}
.mui-fadein {
/-webkit-animation: fadein 0.1s;
animation: fadein 0.1s;/
opacity: 1;
}
.mui-fadeout {
opacity: 0;
}
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@-webkit-keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes fadeout {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@-webkit-keyframes fadeout {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 id="title" class="mui-title">下拉刷新和上拉加载更多</h1>
</header>
<div class="mui-content">
<div class="mui-loading"></div>
</div>
</body>
<script>
mui.init({
subpages:[{
url:"Content_03_test.html",//下拉刷新内容页面地址
id:"Content_03_test.html",//内容页面标志
styles:{
top: "48px",
bottom: "0px",
bounce: "vertical"
}
}]
});
</script>
</html>
内容页面代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></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">
<link rel="stylesheet" href="css/list_004.css">
<script src="js/mui.min.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<ul class="mui-table-view mui-table-view-chevron" id="contentList">
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
马尔代夫-天堂鸟
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
马尔代夫-葫芦马累岛
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
马尔代夫-马累岛
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
天空之城-中式篇
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
天空之城-欧式篇
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
中国风
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
中国风
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="#" class="mui-navigate-right">
<img class="mui-media-object mui-pull-left" src="images/hunsha/2245904_152832037915_2.png">
<div class="mui-media-body">
中国风
<p class='mui-ellipsis'><em>¥9999</em></p>
</div>
</a>
</li>
</ul>
</div>
</div>
<script>
mui.init({
swipeBack: false,
pullRefresh: {
container: '#pullrefresh',
down: {
callback: pulldownRefresh
},
up: {
contentrefresh: '正在加载...',
callback: pullupRefresh
}
}
});
/**
- 下拉刷新具体业务实现
*/
function pulldownRefresh() {
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('#pullrefresh').pullRefresh().endPulldownToRefresh(); //refresh completed
}, 1500);
}
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);
}
}, 1500);
}
if (mui.os.plus) {
mui.plusReady(function() {
setTimeout(function() {
mui('#pullrefresh').pullRefresh().pullupLoading();
}, 1000);}); } else { mui.ready(function() { mui('#pullrefresh').pullRefresh().pullupLoading(); }); } </script>
</body>
</html>
等烟雨 (作者)
截图了,就是下面有个灰色的条条
2015-01-13 14:39