无限滚动jQuery [英] infinite scroll jQuery

查看:81
本文介绍了无限滚动jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.
我正在实现无限滚动,我希望在滚动到达页面末尾之前先加载页面,例如要剩余50像素.
我知道我可以做下面的事情,但是不起作用.
我该怎么办?

hi.
Im implementing infinite scrolling,i want the pages to be loaded before scroll reaches the end of page,like 50 pixels remaining to end.
i know i can do something like below,but its not working.
how should i do that?

$(window).scroll(function(){
        if  ($(window).scrollTop() == $(document).height() - $(window).height()-50){
           lastPostFunc();
        }
});

推荐答案

(window).scroll(function(){ 如果(
(window).scroll(function(){ if (


(窗口).scrollTop()==
(window).scrollTop() ==


(文档) .height()-
(document).height() -


这篇关于无限滚动jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆