Polyfill for position: sticky;
Switch branches/tags
Nothing to show
Clone or download
vnovick Merge pull request #23 from vnovick/master
In minified css last ';' is ommited. as a result polyfill brakes. This fix adds semicolon if it's ommited
Latest commit 3671ac5 Jun 16, 2015
Failed to load latest commit information.
.gitignore Added a gitignore Feb 25, 2013
README.md Cleaned up README May 2, 2013
package.json fixed orientation change issue May 31, 2015
sticky.js fixed orientation change issue May 31, 2015


position: sticky; The polyfill!

This shim/polyfill is based on this polyfill, except my version has no dependencies. Yay! Additionally, this polyfill will add a class .stuck when in the sticky position (and remove it when not).


Simply include the polyfill:

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

And that's it. Simply use CSS as you normally would, for example:

.my-sticky-element {
  position: sticky;
  top: 20px;

.my-sticky-element.stuck {
  box-shadow: 0px 4px 13px #8E8E8E;