An AngularJS directive that makes scrolling seamless on your page.
- Chrome, Safari, Opera, FireFox, IE
Clone the repository and include directly into your project. You can also use bower and install as a dependency:
bower install ng-smooth-scroll --save
Add the dependency in your Angular's project dependency arguments:
var app = angular.module('MyApp', [
'ng-smooth-scroll'
]);Make sure you reference the script in your javascript:
<script src="bower_components/ng-smooth-scroll/ng-smooth-scroll.js"></script>** Note: Currently, I am adding data-ng-smooth-scroll to my html class, like below. I don't necessarily link this, but will try and come up with a better implementation. **
<html ng-app='example' data-ng-smooth-scroll>ng-smooth-scroll looks for the target href and a class on the link you're looking for, ex. `scroll-to'
Example:
<a href='#one' class='scroll-to'>One</a>
<a href='#two' class='scroll-to'>Two</a>