• mui小总结


    下拉刷新

        第一:

    mui.init({
    		pullRefresh: {
    			container: '#pullrefresh',
    			up: {
    				contentrefresh: '正在加载...',
    				callback: pullupRefresh
    			}
    		}
    	});	
    

      

        第二:

    	var i = 0;
    	var count = 0;
    	var number = 1;
    	function pullupRefresh(){
    		setTimeout(function(){		
    			$(function(){
    				var json = {};
    				json.competitionID = CompetitionID;
    				json.fightTypeID = fightTypeID;
    				json.action = 'getFightType';
    				$.post('http://192.168.3.12:11000/api/Competition', json, function(e){
    					var obj = eval("(" + e + ")");
    					var data = obj.data[0].v_teamfight;
    					if(number > data.length){
    						number = data.length;
    					}
    					var counts = parseInt(data.length/2)+1;    //定义上拉次数
    					mui('#pullrefresh').pullRefresh().endPullupToRefresh((++count >counts)); //判定是否拖动 
    					for(i; i < number; i++){
    						var str = '';
                                                    str += "<span>" + data[i].TeamAName + "</span>"; //A队名称
    						str += "</div><div>vs</div><div>";
    						str += "<img src='../../img/hwq/gold.png'/>"; //B队logo路径(暂无)
    						str += "<span>" + data[i].TeamBName + "</span>"; //B队名称
                                                    $("#content").append(str);
                                             }
                                         number+=1;
    				});
    			});
    		},100);
    	}
            

        第三:

    if(mui.os.plus){
    		mui.plusReady(function(){
    			setTimeout(function(){
    				mui('#pullrefresh').pullRefresh().pullupLoading();
    			},10);
    		});
    	} 
    	else {
    		mui.ready(function() {
    			mui('#pullrefresh').pullRefresh().pullupLoading();
    		});
    	}
    

      

  • 相关阅读:
    Ubuntu16.04下Django项目的部署
    Ubuntu16.04 下python2 | python3
    请求头请求体对应表
    Django项目开发-小技巧
    前端验证后端验证码问题
    Ugly Number
    移动0元素
    图片(画布上的图片)上传总结
    从矩阵中查找一个数
    搜索框(附带事件函数)
  • 原文地址:https://www.cnblogs.com/zst062102/p/5766063.html
Copyright © 2020-2023  润新知