https://github.com/one-com/knockout-bottomsup
Knockout.js binding that keeps an element scrolled to the bottom
https://github.com/one-com/knockout-bottomsup
Last synced: 8 months ago
JSON representation
Knockout.js binding that keeps an element scrolled to the bottom
- Host: GitHub
- URL: https://github.com/one-com/knockout-bottomsup
- Owner: One-com
- License: bsd-3-clause
- Created: 2014-07-14T16:30:46.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T13:03:48.000Z (about 9 years ago)
- Last Synced: 2025-08-24T02:59:09.873Z (9 months ago)
- Language: JavaScript
- Size: 131 KB
- Stars: 3
- Watchers: 13
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A Knockout.js binding for keeping an element bound to an observable array scrolled to the bottom.
[Click here to see an example](http://one-com.github.io/knockout-bottomsup/examples/)
Usage:
```html
- ...
```
Whenever `myObservableArray` changes, the `
- ` 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:
```html
```
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.