Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    knockout-bottomsuppublic

    A Knockout.js binding for keeping an element bound to an observable array scrolled to the bottom.

    Click here to see an example

    Usage:

    <ul style="overflow: auto; height: 100px;"
        data-bind="foreach: myObservableArray, bottomsUp: true">
      <li>...</li>
    </ul>

    Whenever myObservableArray changes, the <ul> will be scrolled to the bottom if it was at the bottom before the change. Thus the user can turn off the behavior by scrolling the element up.

    If you want to prune the array while the element is scrolled to the bottom, use the trim option to specify the maximum number of items to retain:

    <ul style="overflow: auto; height: 100px;"
        data-bind="foreach: myObservableArray, bottomsUp: {trim: 25}">
      <li>...</li>
    </ul>

    This is useful for logs that you don't want to grow infinitely.

    License

    Knockout.dragdrop is licensed under a standard 3-clause BSD license -- see the LICENSE file for details.

    Keywords

    none

    install

    npm i knockout-bottomsup

    Downloadslast 7 days

    4

    version

    1.0.1

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar