繁体   English   中英

当页面底部滚动时,jQuery将加载更多内容

[英]jQuery load more content when Scroll at bottom of the page

滚动到页面底部时,jQuery将加载更多内容。 我的脚本在Safari / iPad浏览器和android Mozilla浏览器上运行良好。 但不适用于Android默认浏览器和Chrome浏览器。

$("#div").scroll(function() {
    if ($(this).scrollTop() >= ($(this)[0].scrollHeight - $(this).outerHeight())) {
        // load more  content function            
    }
});

尝试这个

$("#div").animate({scrollTop: $("#div")[0].scrollHeight}, 1000);
    $('#div').scroll(function() {
    //content goes here
     });

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM