添加无限滚动到视图页面

时间:2013-04-04 19:55:35

标签: javascript asp.net-mvc infinite-scroll

我在更改无限滚动javascript时遇到了一些麻烦,因此它可以在我的视图页面上运行,而不确定要更改或添加的内容。我正在使用knockout 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)
};

0 个答案:

没有答案