Skip to content

matthewp/position--sticky-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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).

Usage

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;
}

About

Polyfill for position: sticky;

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published