A Auto Scrolling Plugin for KnockoutJS
- Pull down the code from https://github.com/bao1018/KnockoutScrollTo.git
- Include knockout and Knockout ScrollTo in your code
<script type="text/javascript" src='knockout.js'></script> <script type="text/javascript" src='knockout-scroll-to.js'></script>
- If you want to observe a array change, if will scroll the last element if you append a element to that array
ko.observableArray().extend({scrollTo: {containerSelector: 'container_selector'}})
If you want to observe a variable change, the vairable should be the selector of the target element yyou want to scroll to
ko.observable().extend({scrollTo: {containerSelector: 'container_selector'}})
See how to use it in example folder
MIT license - http://www.opensource.org/licenses/mit-license.php
- Add animation support
- Improve the array observe feature ...