Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.02 KB

File metadata and controls

38 lines (24 loc) · 1.02 KB

Knockout ScrollTo

A Auto Scrolling Plugin for KnockoutJS

Get Started

  1. Pull down the code from https://github.com/bao1018/KnockoutScrollTo.git
  2. 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>
  1. 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

License

MIT license - http://www.opensource.org/licenses/mit-license.php

TODO

  1. Add animation support
  2. Improve the array observe feature ...