jQuery实现瀑布流的取巧做法分享

2020-05-23 06:13:34易采站长站整理

                /* ajax
                ——————–*/
                // $.get(url,{ page:page,count:30 },function(json){
                //     if(json.status==1){
                //         _that.appendHTML(json.data);
                //         on_off = true;
                //         page++;
                //     }else{
                //         _that.loadedTips();
                //     }
                // },’json’);
                /* 模拟测试-设置定时器模拟ajax请求数据
                ———————–*/
                setTimeout(function(){
                    // 模拟终止
                    if(page==3){
                        _that.loadedTips();
                        return;
                    }
                    _that.appendHTML(testJson.data);
                    on_off = true;
                    page++;