Skip to content

jonathantneal/angular-sticky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Sticky

Angular Sticky is an AngularJS directive that gives you the ability to keep any element on your page visible.

Usage

To use Angular Sticky, add the script to the head of your document.

<head>
	<script src="angular-sticky.js"></script>
</head>

Next, add the sticky directive to your angular app.

<script>
angular.module('demo', ['sticky'])
</script>

Finally, add a sticky attribute to an element.

<div ng-app="demo">
	<p sticky sticky-top="48" sticky-top="48" sticky-media="(min-width:640px)">This sticks to the top of the page.</p>
</div>

Options

  • sticky: Enables an element to become sticky.
  • sticky-top: Pixels between the top of the page and the sticky element.
  • sticky-bottom: Pixels between the bottom of the page and the sticky element.
  • sticky-media: Media query required to enable sticky.

Demo

See a sticky demonstration leveraging all of the available options.


The documented script is 3.11KB, and the compressed script is 572 bytes.

About

Keep any element on your page visible

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published