🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ let item_total = 30 // $(function () { $(window).scroll(function () { if (item_total > 10) { var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).height(); if (scrollTop + windowHeight+2 >= scrollHeight) { if (ajax_status) { return; } ajax_page++; $.ajax({ type: "get", url: w3url + "" + ajax_page, success: function (result) { ajax_status = false; $("div.data_result_list").append(result); if (result.length < 12) { ajax_status = true; } computedAll() }, error: function () { ajax_status = true; } }); } } }); }); ~~~