1***@qq.com
1***@qq.com
  • 发布:2017-05-24 16:22
  • 更新:2017-05-24 16:22
  • 阅读:1100

官方的上拉例子可以打开,我复制一份就打不开了额 不是包的问题

分类:MUI
mui

<!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;  
            }  
        </style>  
    </head>  

    <body>  
        <div id="pullrefresh" class="mui-content mui-scroll-wrapper">  
            <div class="mui-scroll">  
                <div class="title">  
                    这是webview模式选项卡中的第5个子页面,该页面展示一个支持上拉加载的消息列表  
                </div>  
                <ul class="mui-table-view mui-table-view-chevron">  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 1</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 2</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 3</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 4</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 5</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 6</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 7</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 8</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 9</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 10</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 11</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 12</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 13</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 14</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 15</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 16</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 17</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 18</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 19</a>  
                    </li>  
                    <li class="mui-table-view-cell">  
                        <a href="" class="mui-navigate-right">娱乐-Item 20</a>  
                    </li>  
                </ul>  
            </div>  
        </div>  
        <script src="js/mui.min.js"></script>  
        <script>  
            mui.init({  
                swipeBack: false,  
                keyEventBind: {  
                    backbutton: false //关闭back按键监听  
                },  
                pullRefresh: {  
                    container: '#pullrefresh',  
                    up: {  
  height:50,//可选.默认50.触发上拉加载拖动距离  
//    auto:true,//可选,默认false.自动上拉加载一次  
      contentrefresh : "正在加载...",//可选,正在加载状态时,上拉加载控件上显示的标题内容  
      contentnomore:'没有更多数据了',//可选,请求完毕若没有更多数据时显示的提醒内容;  
                        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);  
                 this.endPullupToRefresh(true|false);  
            }  
        </script>  
    </body>  

</html>
2017-05-24 16:22 负责人:无 分享
已邀请:

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