0.1.6 • Published 5 years ago

scroll-state v0.1.6

Weekly downloads
12
License
MIT
Repository
github
Last release
5 years ago

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!
0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago