iscroll-sticky

iOS-style sticky headers with iScroll 5

Usage no npm install needed!

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

README

iscroll-sticky

Sticky headers for iScroll 5. Inspired by iscroll-stickyheader for iScroll 4.

Installation

bower install iscroll-sticky

The repository provides a prebuilt version.

Usage

Note: This plugin depends on iscroll-probe.js, as special kind of iScroll 5 build.

Set your IScroll HTML up as usual. Then set the probeType in the IScroll contructor and instantiate the sticky header with the iScrollSticky constructor. For example:

var scroll = new IScroll('#scroll', { probeType: 3 });
new IScrollSticky(scroll, 'h1');

In this example, the scrolling wrapper element has the id scroll and the sticky headers are h1 tags. You can use any CSS3 selector in IScrollSticky constructor as its second argument.

Contributing

See Contributing

Release History

See Changelog

License

MIT