@3dwayfinder/scrollarea
v1.0.22
Published
A vanilla JS scrollarea that supports touch, mouse and scrollwheel
Downloads
154
Maintainers
Readme
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;
}