我在更改无限滚动 javascript 时遇到了一些麻烦,因此它可以在我的视图页面上运行,并且不确定要更改或添加什么。我正在使用淘汰赛 js 用 JSON 加载我的数据。
查看页面
<section id="rosterImages">
<section id="users" data-bind="foreach: RosterUsers">
<div id="nameImage">
<figure>
<img width="158" height="158" alt="Gravatar" data-bind="attr:{src: GravatarUrl}"/>
</figure>
<span data-bind="text:Name"></span>
</div>
</section>
</section>
来自https://github.com/paulirish/infinite-scroll的无限滚动 Javascript
$.infinitescroll.defaults = {
loading: {
finished: undefined,
finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>",
img: "data:image/gif;base64...",
msg: null,
msgText: "<em>Loading the next set of posts...</em>",
selector: null,
speed: 'fast',
start: undefined
},
state: {
isDuringAjax: false,
isInvalidPage: false,
isDestroyed: false,
isDone: false, // For when it goes all the way through the archive.
isPaused: false,
currPage: 1
},
debug: false,
behavior: undefined,
binder: $(window), // used to cache the selector
nextSelector: "div.navigation a:first",
navSelector: "div.navigation",
contentSelector: "section", // rename to pageFragment
extraScrollPx: 150,
itemSelector: "div.post",
animate: false,
pathParse: undefined,
dataType: 'html',
appendCallback: true,
bufferPx: 40,
errorCallback: function () { },
infid: 0, //Instance ID
pixelsFromNavToBottom: undefined,
path: undefined, // Either parts of a URL as an array (e.g. ["/page/", "/"] or a function that takes in the page number and returns a URL
prefill: false, // When the document is smaller than the window, load data until the document is larger or links are exhausted
maxPage: undefined // to manually control maximum page (when maxPage is undefined, maximum page limitation is not work)
};