jquery实现滚动到页面底部时无限加载内容的代码
分类:
IT文章
•
2023-12-15 22:26:13
- var p="{$other.p}";
- if(p=="") p=1;
- var stop=true;
- $(window).scroll(function() {
-
- if ($(this).scrollTop() + $(window).height() + 100 >= $(document).height() && $(this).scrollTop() > 100) {
-
- if(stop==true){
- stop=false;
- p=p+1;
- canshu="?t={$other.t}&p="+p+"&cid={$other.cid}";
-
- $("#showlists").append("<li class='ajaxtips'><div style='font-size:2em'>Loding.....</div></li>");
- $.get("__URL__/nextpage"+canshu,function(data){
- $(".ajaxtips").hide();
- $("#showlists").append(data);
- stop=true;
- })
- }
- }
- });
-