An AngularJS directive for ScrollToFixed
bower install angular-scrolltofixed
First, read the documentation of ScrollToFixed.
Then, inject angular-scrolltofixed
into your application:
angular.module('myApp', ['scrollToFixed']);
And add the directive scroll-to-fixed
to any element that you want to fix:
<p scroll-to-fixed>Hello, world!</p>
scroll-to-fixed
defines the options to pass to ScrollToFixed
.
You can specify them via a plain object in your templates:
<p scroll-to-fixed="{ 'bottom': 0 }">Hello, world!</p>
or a scoped object in your controllers:
$scope.scrollToFixedOptions = {
'bottom': 0
};
<p scroll-to-fixed="scrollToFixedOptions">Hello, world!</p>
ng-model
defines the object to watch and triggers a resize
event on ScrollToFixed
when this object changes.
update
triggers a resize
event on ScrollToFixed
.
$destroy
triggers a detach.ScrollToFixed
event on ScrollToFixed
.
angular-scrolltofixed
is released under the MIT license.