inorganik / angular-scroll-spy

A simple, lightweight scroll-spy directive for angular that was built from scratch.
http://inorganik.github.io/angular-scroll-spy/
MIT License
17 stars 10 forks source link

angular-scroll-spy

A simple, lightweight scroll-spy directive for angular that was built from scratch. It broadcasts events as elements are scrolled into or out of view.

Try the demo

Usage

Add the scroll-spy attribute and an id on the element you want to receive a scroll event for.

Then in your controller, you can respond to events like this:

$scope.$on('elementFirstScrolledIntoView', function (event, data) {
  if (data === 'myElementId') {
    // do something
  }
});