`
kt431128
  • 浏览: 37267 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

jquery滚轮滚动到页面底部异步加载数据

 
阅读更多

var totalheight = 0;  

function loadData(){ 

            totalheight = parseFloat(jQuery(window).height()) + parseFloat(jQuery(window).scrollTop());  

 

            if (jQuery(document).height() <= totalheight) {  

 

                     jQuery.post("",{},function(data){

                 if(data!=null && data.trim()!=""){

                                              if(count%4==0){

                                              jQuery(".chapter_content").html(data);

                                                                     }else{

                                                                        jQuery(".chapter_content").append(data);

                                                                            }

                                                               }

                                              });

                                                 }

                                                    }

 

jQuery(document).ready(

               function(){

                     jQuery(window).scroll( function() { 

                                    loadData();

                               }); 

                         });

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics