h5滚动条加载到底部

https://www.zhihu.com/question/31861301

重复加载问题

http://www.jianshu.com/p/12aa901bee1f?from=timeline

 window.onscroll= function () {
                    var clientHeight=$(window).height();
                    var scrollTop =$(window).scrollTop();
                    var offsetHeight=$(document).height();
                    /*console.log('clientHeight='+clientHeight);
                    console.log('scrollTop='+scrollTop);
                    console.log('offsetHeight='+offsetHeight);*/

                    localStorage.scrollHeight=scrollTop;

                    if(clientHeight+scrollTop>=offsetHeight)
                    {

                        var keyword=localStorage.txt;
                        var condition=localStorage.condition;
                        var page=localStorage.page;
                        obj._render(keyword,condition,page)
                    }
                };

 

posted @ 2017-10-21 08:00  layfork  阅读(591)  评论(0编辑  收藏  举报