@3dwayfinder/scrollarea

1.0.12 • Public • Published

scrollarea

A vanilla JS scrollarea that supports touch, mouse and scrollwheel

Usage

let area = document.getElementById("scrollarea");
let sa = new ScrollArea(area);

CSS

Make the container fixed height, overflow hidden. And the scrollable container as big as needed. To show a scrollbar add some styles to

.sa-content-longer .sa-scrollbar {
    width: 1em;
    background-color: lightblue;
}

.sa-content-longer .sa-bar {
    width: 1em;
    background-color: antiquewhite;
}

Package Sidebar

Install

npm i @3dwayfinder/scrollarea

Weekly Downloads

6

Version

1.0.12

License

MIT

Unpacked Size

85.7 kB

Total Files

7

Last publish

Collaborators

  • salarelv