MUIドロップダウンリフレッシュアップロード実装

4654 ワード

DOM構造
<div id="refreshContainer" class="mui-content mui-scroll-wrapper">
    <div class="hui-media-list mui-scroll">
        
    id="con">
div> div>

JS部
mui.init({
          pullRefresh : {
            container:"#refreshContainer",//        ,querySelector    css     ,  :id、.class 
            down:{
                callback :aaa //  ,    ,         ,    ajax         ;
                },
            up: {
                contentrefresh: '    ...',
                contentnomore:'       ',
                callback: bbb
                }
          }
        });
        function aaa(){
            mui('#refreshContainer').pullRefresh().endPulldownToRefresh();
        }
        function bbb(){
            for (var i=0;i<9; i++) {
                $('#con').append('<li><a href=""><div class="hui-media-content hui-media-content-left"><h1>    ....h1><p>power by hcoder.netp>div><div class="hui-media-list-img"><img src="img/    .jpg" />div>a>li>')
            }
            this.endPullupToRefresh(true|false);
            mui('#refreshContainer').pullRefresh().enablePullupToRefresh();
        }
        mui.plusReady(function(){
            for (var i=0;i<9; i++) {
                $('#con').append('<li><a href=""><div class="hui-media-content hui-media-content-left"><h1>    ....h1><p>power by hcoder.netp>div><div class="hui-media-list-img"><img src="img/    .jpg" />div>a>li>')
            }
        })