解决mui上拉加载-手机端焦点卡顿灵敏失效的问题----利用的swipeup(此方法虽然不流畅--但是效果比mui的要好的多)

mui.init({
                //监听
                gestureConfig:{
                    swipeup:true,//向上滑动
                    swipedown:true,
                    dragstart:true,//开始拖动
                    drag:true,//拖动中
                    dragend:true,//拖动结束
                    
               },
                swipeBack: true, 
                pullRefresh: {
                    container: "#refreshContainer", 
                    down: {
                        auto: false, 
                        callback: refreshData 
                    },
                    
                }
            });
//请求下一页数据//上拉
        document.addEventListener("swipeup",function(){
                
                mui.ajax(url+"/front_get_advertisment.do?page_num=" + pagenum, {
                    type: "GET",
                    async:false,
                    dataType: "jsonp",
                    success: function(data) {
                        pagenum++;
                        console.log("成功2");
                        var json_data = jQuery.parseJSON(data);
                        data_news.news=data_news.news.concat(convert(json_data.list));
                        //console.log(data_news.news[0].images);
                        if(pagenum>json_data.totalpage){
                        //mui.toast("没有更多数据了");
                        console.log("没有更多数据了");
                        $("#nulldata").html("No more data");
                    }
                        
                        
                    },
                    error: function(xhr, type, errorThrown) {
                    mui('#refreshContainer').pullRefresh().endPullupToRefresh();
                    //异常处理;
                    mui.toast("Query Failed - Temporarily Inaccessible"); 
                    }
                });
            })

 

posted @ 2019-08-16 14:57  小白咚  阅读(890)  评论(0编辑  收藏  举报