Pure javascript AngularJS directive to make elements stick when scrolling
This repository contains a set of native AngularJS directives and services. It can be used without any other dependency except of course Angular.
A few noteworthy things:
To install Angular Sticky with Bower use
bower install angular-sticky-plugin
Or with npm
npm install angular-sticky-plugin
Click the download button to download the latest version of the plugin. In the folder dist
you'll find the minified and normal JavaScript file.
Either one is fine to use, it just depends on your needs.
As soon as you've got all the files downloaded and included in your page you just need to declare a dependency on the module:
angular.module('myModule', ['hl.sticky']);
This will make an element sticky using the directive hl-sticky
:
I'll become sticky
To see this in action, check out out the demo. What more do you want? Right, more features. Well, that can be arranged.
Angular Sticky has been set up in such a way so it uses a lot of the handy features you're probably used to from Angular. A combination between between directives and services make the difference between all the other (native) sticky plugins. It allows you to have more control over the the look and feel of your sticky elements from both HTML and from code.
To get a better understanding of the features, make sure you read through the API documentation.