angular-sticky

Pure javascript AngularJS directive to make elements stick when scrolling down
Homepage:
9 people use it
Author: 166f78b9aca517aaf31dde4c7761b9e4?d=https%3a%2f%2fidenticons.github.com%2fb983f83851bcd5f3c2b214e21f990f7e d-oliveros

Angular Sticky

A simple, pure javascript (No jQuery required!) AngularJS directive to make elements stick when scrolling down.

Features

  • Allows use of an offset so elements can be sticked to ej. 50px from the top of the browser
  • Recalculates element position on page load and on window resize
  • Clean: No classes are added, no jQuery is required, no CSS files or configuration is needed.

Usage

Include the .js file in your page then enable usage of the directive by including the "sticky" module as a dependency. Use the directive as follows:

To make the element stick within a certain offset of the top of the screen, you can provide an offset as follows:

Cheers.

comments powered by Disqus
This page was last updated about 3 years ago.