Home

Awesome

Sticky JS

Elements stick to the top of the viewport when the user scrolls down.

Installation

$ component install pazguille/sticky

See: https://github.com/component/component

Standalone

Also, you can use the standalone version:

<script src="sticky.js"></script>

How-to

sticky(node, {
   boundary: 200,
   fn: function () {}
});
sticky();
sticky(node);
sticky(node, 200);
sticky(node, function () {});

API

sticky([el], [options])

Elements stick to the top of the viewport when the user scrolls down.

sticky(node, {
   boundary: 200,
   fn: function () {}
});

sticky.destroy(el)

Elements stick to the top of the viewport when the user scrolls down.

sticky.destroy(node);

Maintained by

License

Licensed under the MIT license.

Copyright (c) 2013 @pazguille.