scroll-state
TypeScript icon, indicating that this package has built-in type declarations

0.1.6 • Public • Published

scroll-state

Usage

<section data-scroll-root="myScrollArea1">
    <div class="someFixedGraphics">
        <img src="/some/img.jpg" data-scroll-bound="welcome" />
        <img src="/some/other-img.jpg" data-scroll-bound="someOtherStuff,center" />
    </div>
    <article data-scroll-trigger="welcome">
        <!-- some content -->
    </article>
    <article data-scroll-trigger="welcome,center">
        <!-- some more content -->
    </article>
    <article data-scroll-trigger="someOtherStuff">
        <!-- some other content -->
    </article>
</section>
import { ScrollMotion } from 'scrollmotion';

// ... and done!
const inst = new ScrollMotion('myScrollArea1');
console.log(inst.node); // section.data-scroll-root
inst.unbindScrollListener(); // ... nothing happens anymore on scroll!

Readme

Keywords

none

Package Sidebar

Install

npm i scroll-state

Weekly Downloads

1

Version

0.1.6

License

MIT

Unpacked Size

88.1 kB

Total Files

34

Last publish

Collaborators

  • janbiasi