Skip to content

inorganik/angular-scroll-spy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Usage

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

  • 'elementFirstScrolledIntoView' is fired once when the element first scrolls into view
  • 'elementScrolledIntoView' is fired every time the element scrolls into view
  • 'elementScrolledOutOfView' is fired every time the element is scrolled out of view

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

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

About

A simple, lightweight scroll-spy directive for angular that was built from scratch.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages