https://github.com/patrickmarabeas/ng-scrollspy.js
An AngularJS module for navigation highlighting
https://github.com/patrickmarabeas/ng-scrollspy.js
Last synced: 7 months ago
JSON representation
An AngularJS module for navigation highlighting
- Host: GitHub
- URL: https://github.com/patrickmarabeas/ng-scrollspy.js
- Owner: patrickmarabeas
- License: mit
- Created: 2013-10-23T08:47:38.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-02-09T09:17:28.000Z (over 10 years ago)
- Last Synced: 2025-03-23T18:53:03.096Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://patrickmarabeas.github.io/ng-ScrollSpy.js
- Size: 5.6 MB
- Stars: 26
- Watchers: 2
- Forks: 9
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-ScrollSpy.js
### ng-ScrollSpy is an AngularJS module for navigation highlighting.
Grab it with Bower:
bower install ng-ScrollSpy.js
Include it in your AngularJS application
var myApp = angular.module( 'myApp', [ 'ngScrollSpy' ] );
The following line is your navigation item element which will be given an `active` class when the specified ID is spied upon. It is element type unspecific. You can listen for multiple elements with pipe separation.
myID
multiple
This is the element you wish to spy on. Offset can be set specifically on elements as well.
There are some global config options available:
myApp.config([ 'scrollspyConfigProvider', function( scrollspyConfigProvider ) {
scrollspyConfigProvider.config = {
offset: 250, //offset added to element
//include your fav throttle function
throttle: _.throttle,
//or define your own
throttle: function(e,t,n){var r,i;return function(){var s=n||this;var o=+(new Date),u=arguments;if(r&&o