angular-momentum-scroll

Momentum scroll for AngularJS based on iScroll
Homepage:
2 people use it
Author: Assets.github.com%2fimages%2fgravatars%2fgravatar-user-420 wzr1337

angular-momentum-scroll

AngularJS directive that adds momentum scroll via iScroll (http://cubiq.org/iscroll-4).

Demo

Find a demonstration on http://wzr1337.github.com

Usage

  • Include scrollable.js or scrollable.min.js into your page
  • Declare 'angular-momentum-scroll' as a dependency for your angular app: angular.module('myApp', ['angular-momentum-scroll']);
  • Add the scrollable attribute to a container of your choice:
    • the container MUST have set width and height !!
    • in order to scroll horizontally the .scroller class inside of your container MUST have set width and height !!
  • The container takes an additional attribute parameters according to iScroll docs. e.g.

  • You can register any of the following handlers by specifying a callback function via attribute:

    • onRefresh
    • onBeforeScrollStart
    • onScrollStart
    • onBeforeScrollMove
    • onScrollMove
    • onBeforeScrollEnd
    • onScrollEnd
    • onTouchEnd
    • onDestroy
    • onZoomStart
    • onZoom
    • onZoomEnd
  • You can bind a variable to the curr-page-x and curr-page-y attribute. The data binding is bidirectional, so that you can scroll programatically as well as being notified on page change.

comments powered by Disqus
This page was last updated almost 4 years ago.