联系官方销售客服

1835022288

028-61286886

应用插件 版主:官方插件技术组
首页 瀑布流 内容加载完后如何判断已经加载完了
类型:迅睿CMS 更新时间:2024-04-19 14:28:48 return=rs 内容建站系统
插件 内容建站系统 V3.9
应用作者 迅睿官方团队
发布时间 2022-03-01 15:30:06
更新时间 2024-04-03 09:44:20

if(res.msg=='')要怎么结合list_data.html模板来写


{module module=images order=updatetime page=1 pagesize=10 num=50 maxlimit=50 return=rs} 


var Mpage=1;

//滚动显示更多
var scroll_get = true;  //做个标志,不要反反复复的加载
$(document).ready(function () {
    $(window).scroll(function () {
        if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
            scroll_get = false;
            layer.msg('内容加截中,请稍候',{time:1000});
            dr_ajax_load_more();
        }
    });
});

function dr_ajax_load_more(){
    Mpage++;
    $.get('/index.php?s=api&c=api&m=template&name=index_data.html&format=json&page='+Mpage+'&'+Math.random(),function(res){
        $('.footer-cont').hide();
        if(res.code==1){
            if(res.msg==''){
//这里的判断条件需要结合list_data.html模板来写,否则会出现无限的加载了
                layer.msg("已经显示完了",{time:500});
            }else{
                $('#content_list').append(res.msg);
                scroll_get = true;
            }
        }else{
            layer.msg(res.msg,{time:2500});
        }
    }, 'json');
}


插件教程:https://www.xunruicms.com/doc/app-928.html