IT源码网

h5滚动条加载到底部

wyy 2021年02月16日 编程语言 446 0

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) 
                    } 
                };

 

评论关闭
IT源码网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!