等烟雨
等烟雨
  • 发布:2015-01-13 11:42
  • 更新:2015-11-28 14:01
  • 阅读:3226

上拉加载时底部显示“上拉显示更多”的灰条怎么不自动消失,需要再滑动一下才能消失

分类:MUI

字消失了,灰色背景好像卡住了一样,需要滑动一下才能消失,代码如下:
主页面代码:
<!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 11:42 负责人:无 分享
已邀请:
DCloud_UNI_FXY

DCloud_UNI_FXY

截图说明一下

  • 等烟雨 (作者)

    截图了,就是下面有个灰色的条条

    2015-01-13 14:39

灯

是不是4.4以上的系统才有这样的问题,把新增的 li 赋值到界面后,再统一赋值一下 ul 里面的内容就行了。$("ul").html($("ul").html()); 貌似是4.4的系统在调用empty()方法的时候有问题。你可以试一下先。。

DCloud_UNI_FXY

DCloud_UNI_FXY

把你的代码贴一下

  • 等烟雨 (作者)

    代码在上方,所有的都贴上了。。。

    2015-01-14 09:19

lyndsey

lyndsey

这个问踢也遇到了,请问你怎么解决的,能告诉一下么

万变的律

万变的律

我也遇到这个问题怎么解决

该问题目前已经被锁定, 无法添加新回复