无限滚动 jQuery 插件可以在页面内工作吗?
我在页面中使用 无限滚动 插件,但有一个问题:我将它用于隐藏在带有 overflow-y:scroll
CSS 的 div
。这意味着只有 div 内容会滚动。
它有点有效,但您需要滚动整个页面才能下载更多项目。当您仅滚动 div 并且页面保持在同一位置时,情况并非如此。
是否有类似的插件,或者是否有人破解它以使其能够滚动元素内容?
I use infinite scroll plugin in my page, but there's a problem: I use it for a content that is hidden in a div
with overflow-y: scroll
CSS. Which means that only the div contents are scrolled.
It kind of works, but you need to scroll the whole page to make it download more items. When you scroll only the div, and the page stays in the same place, it doesn't.
Is there a similar plugin, or has anyone hacked it to make it work with scrolling of an element contents?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须设置
并将活页夹设置为确实具有溢出的元素。
答案在这里找到:https://github.com/paulirish/infinite-scroll /issues/151#issuecomment-5222520
You have to set
And set the binder to the element with the overflow indeed.
Answer found here: https://github.com/paulirish/infinite-scroll/issues/151#issuecomment-5222520
据我了解,您需要添加选项
binder: $('your div with Overflow')
。然后,当您在此 div 内滚动时,插件将开始加载内容。As i understood, you needed to add option
binder: $('your div with overflow')
. Then the plugin will start loading content when you scroll inside this div.