Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/3dtech/scrollarea

A vanilla JS scrollarea that supports touch, mouse and scrollwheel
https://github.com/3dtech/scrollarea

Last synced: 8 days ago
JSON representation

A vanilla JS scrollarea that supports touch, mouse and scrollwheel

Awesome Lists containing this project

README

        

# scrollarea
A vanilla JS scrollarea that supports touch, mouse and scrollwheel

# Usage

```js
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

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

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