Javascript 添加无限滚动到查看页面

Javascript 添加无限滚动到查看页面,javascript,asp.net-mvc,infinite-scroll,Javascript,Asp.net Mvc,Infinite Scroll,我在修改无限滚动javascript时遇到了一些问题,因此它将在我的查看页面上工作,并且不确定要更改或添加什么。我使用knockoutjs加载带有JSON的数据 查看页面 <section id="rosterImages"> <section id="users" data-bind="foreach: RosterUsers"> <div id="nameImage"> <fi

我在修改无限滚动javascript时遇到了一些问题,因此它将在我的查看页面上工作,并且不确定要更改或添加什么。我使用knockoutjs加载带有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>

无限滚动Javascript来自

$.infinitescroll.defaults={
装载:{
完成:未定义,
finishedMsg:“祝贺你,你已经到达了互联网的尽头。”,
img:“数据:image/gif;base64…”,
msg:null,
msgText:“正在加载下一组帖子…”,
选择器:null,
速度:“快”,
开始:未定义
},
声明:{
isDuringAjax:错,
isInvalidPage:错误,
isDestroyed:错,
isDone:false,//当它一直通过存档时。
我的理由是:错,
第页:1
},
调试:错误,
行为:未定义,
活页夹:$(窗口),//用于缓存选择器
下一个选择器:“div.navigation a:first”,
导航选择器:“div.navigation”,
contentSelector:“节”//重命名为pageFragment
外星X:150,
项目选择器:“div.post”,
动画:假,
路径解析:未定义,
数据类型:“html”,
对,,
缓冲区px:40,
errorCallback:函数(){},
infid:0,//实例ID
pixelsFromNavToBottom:未定义,
path:undefined,//URL的一部分作为数组(例如,[“/page/”,“/”)或接受页码并返回URL的函数
prefill:false,//当文档小于窗口时,加载数据,直到文档变大或链接耗尽
maxPage:undefined//手动控制最大页面(当maxPage未定义时,最大页面限制无效)
};
$.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)
};