We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
来自 jQuery 无限滚动插件的 文档页面:
它应该可以解决你的问题。
From the documentation page of jQuery infinite scroll plugin:
It should solve your problem.
使用当前版本的无限滚动插件 (2.1.0),您可以在加载元素时暂停,然后恢复并检查是否应在单击按钮(或其他任何内容)时加载新内容:
然后
With current version of Infinite Scroll Plugin (2.1.0), you can just pause when the elements are loaded, and then resume and check if new content should be loaded on a button click (or anything else):
and then
如果您正在寻找无限滚动,这是一回事,但只是一个“更多”按钮不需要插件。
HTML
JS
.load 函数将对提供的 URL 进行 AJAX 调用,并且可选选择器将仅拉出特定的匹配项。在这种情况下,如果显示页面的 ?page 参数控制查询的偏移量以提取所需的项目,则 .loading URL 将在每次调用时附加下一组项目。
当然,您可以创建一个独特的 AJAX 页面,仅返回下一组项目的 HTML 片段,但根据您的架构,它会涉及更多一些。但是,这样做可以节省带宽/执行时间。
If you are looking for an infinite scroll, that's one thing, but just a More button shouldn't require a plugin.
HTML
JS
The .load function will make an AJAX call to the URL provided and the optional selector will just pull out that particular matched item. In this case if the ?page parameter to your display page controls the offset to the query to pull the items you want then .loading the URL will append the next set of items every time it is called.
Of course you could make a unique AJAX page that just returns the HTML fragments for the next set of items but it is a little bit more involved depending on your architecture. You will save bandwidth/execution time by doing it, however.
基本上你的身体应该有CSS overflow:scroll 并且更多按钮应该使用jquery追加将更多的html附加到你的容器Div -
Basically you body should have the css overflow:scroll and the more button should append more html to you container Div using jquery append - http://api.jquery.com/append/
当前的Infinite-scroll v3.0.6接受“单击按钮开始加载”按钮,如手册< /a>
允许页面末尾的按钮开始无限滚动。
the current infinite-scroll v3.0.6 accepts a "Click button to start loading" button as stated on the manual
That allow a button at the end of the page to start the infinite scrolling.