Position:sticky that works.
$ npm install --save component-sticky
var Sticky = require('component-sticky');
var sticky = new Sticky(document.querySelector(".sticky-element"), {
...
});
How many pixels to skip from the top
Any element, element selector or bounding box like {top: 0, bottom: 100 } or { top: element, bottom: element }
Class to add when element is sticked
Class to add to a spacer (placeholder when element is stuck)
When element is parked bottom
When element is parked on top
Name of a group to stack elements within. undefined stack won’t relate element to any group
Update position, sizes, sticking. Automatically called on window resize.
Unhook sticky controller from element. Called automatically when element is removed.
Enable previously disabled sticky element.