Skip to content

3dtech/scrollarea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
}

About

A vanilla JS scrollarea that supports touch, mouse and scrollwheel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published