gpt4 book ai didi

javascript - 当用户到达页面右侧时加载新内容

转载 作者:行者123 更新时间:2023-11-30 05:55:49 28 4
gpt4 key购买 nike

有很多插件允许在用户到达页面底部时加载内容,但是我找不到允许您在用户到达文档右侧时加载内容的 jquery 插件。

有什么好的策略可以做到这一点吗?

有没有好的插件可以做到这一点?

谢谢,彼得

最佳答案

$('div').scroll(function (){
var padder = 50;
if( $(this).scrollLeft() >= $(this).scrollWidth -padder){
//load more content as the user has scrolled 50px less than, the end,
}
})

我认为像这样的东西可以做到......

关于javascript - 当用户到达页面右侧时加载新内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12002686/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com