position-sticky
Polyfill for position: sticky;
.
Usage
Load position-sticky.min.js
.
<script src="dist/position-sticky.js"></script>
Create PositionSticky()
instance and call attach()
.
var positionSticky = PositionSticky(document.querySelector('.sticky'));
positionSticky.attach();
If you want to stop, call detach()
of instance.
positionSticky.detach();
To use as Web Components Extension, set is="position-sticky"
to <div>
.
<div is="position-sticky"></div>