<div class="intro">
 <p>ZUI ScrollSnapper is a scrollView plugin to replace YUI3 ScrollViewPaginator plugin. It provides same interface and namespace, and better user interaction.</p>
</div>

<h2>Description</h2>
<p>Just plug Y.zui.ScrollSnapper into a scrollView, with correct css selector for pages. After scrollEnd, the scrollView will snap to most near page.</p>
<p>Why ZUI ScrollSnapper better than YUI3 ScrollViewPaginator? Because ZUI ScrollSnapper supports:
 <ol>
  <li>flick then snap interaction. (YUI3 ScrollViewPaginator do not allow flick)</li>
  <li>flick more than one page. (YUI3 ScrollViewPaginator only allow prev/next page)</li>
 </ol>
</p>
<h2>Note</h2>
<ul>
 <li>The algorithm of 'snapTo' can be changed into 'Bipartite approximation' , for better performance. Current we just use linear search, when user scrollTo last items we run into worst case.</li>
 <li>This plugin only handle gestures, do not handle scrollTo() method.</li>
</ul>
<h2>Known Issue</h2>
<ul>
 <li>Some webkit browsers will cause page position calculation wrong, in this case you may add a style 'position:relative' on contentBox to fix it.</li>
 <li>If you have a lots of pages in the scrollView, the 'snapTo' calculation may take longer time. You should do performance test for this case.</li>
</ul>
<h2>Sample Code</h2>
```
YUI().use('gallery-zui-scrollsnapper', function(Y) {

    // Make the scrollView snap to child li element
    var scroll = new Y.ScrollView(...).plug(Y.zui.ScrollSnapper);

    // Or, snap to div
    anotherScroll = Y.ScrollView(...).plug(Y.zui.ScrollSnapper, {selector: '> div'});

    // Same interface with ScrollViewPaginator
    scrollview.pages.set("index", 3);
    scrollview.pages.scrollTo(3, 0.6, "ease-in");
    scrollview.pages.next();
    scrollview.pages.get("total");

});
```
