position-sticky

Emulation of position: sticky; using JavaScript

Usage no npm install needed!

<script type="module">
  import positionSticky from 'https://cdn.skypack.dev/position-sticky';
</script>

README

position-sticky

Emulation of position: sticky; using JavaScript.

Usage

Load position-sticky.min.js.

<script src="dist/position-sticky.js"></script>

Call PositionSticky() with element as argument.

<script>PositionSticky(document.querySelector('.sticky'));</script>

If you want to use this as Web Components Extension, set is="position-sticky" to <div>.

<div is="position-sticky"></div>

License

MIT: http://1000ch.mit-license.org